/* ==================================================
   🎨 Base Layout and Typography
   ================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 2rem 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    color: #f0f0f0;
    background: rgba(246, 245, 245, 0.7);
}

/* ==================================================
   🧭 Header
   ================================================== */

header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background-color: rgba(248, 244, 244, 0.8);
    color: #222;
    font-size: 14px;
    ;
    border-bottom: 1px solid #444;
}

header a {
    color: #00bcd4;
    text-decoration: none;
    font-weight: bold;
}

/* ==================================================
   📦 Main Content Container
   ================================================== */

.main-content {
    max-width: 800px;
    margin: 3.75rem auto;
    padding: 2.5rem;
    background-color: rgba(20, 20, 20, 0.85);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.main-content h1 {
    font-size: 14px;
    ;
    margin-bottom: 1.25rem;
    color: #00e5ff;
}

.main-content p {
    font-size: 14px;
    ;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .main-content {
        padding: 1.25rem;
    }
}

/* ==================================================
   🧾 Footer
   ================================================== */

footer {
    text-align: center;
    padding: 1.25rem;
    color: #aaa;
    font-size: 14px;
    ;
}

h4,
h5 {
    font-size: 14px;
    margin: 1rem 0 0.1rem;
    color: #f6f3f3;
}

h2 {
    font-size: 12px;
    color: hsl(0, 33%, 99%);
}

h3 {
    font-size: 18px;
    color: hsl(0, 0%, 2%);
    text-align: center;
}

h5 {
    margin: .5rem 0 0.3rem;
    font-size: 14px;
}

.header-bar,
.site-header,
.main-header {
    padding-top: 2px;
    padding-bottom: 2px;
    line-height: 1;
}

/* Wrapper block for document number + button */
/* Wrapper block for document number + button */
/* Header container */
.doc-header-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 10px 0;
    background: #1e1e1e;
    /* Dark background */
    color: #7da1ef;
    /* Light text */
    width: 100vw;
    /* margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw); */
    /* padding-left: 1rem;
    padding-right: 1rem; */
}
.doc-header-block {
    margin-bottom: 2px;
    /* reduce space below the header */
}

.navigation-buttons {
    margin-top: 0;
    /* remove extra space above Add Cargo */
    margin-bottom: 4px;
    /* optional: tighten space below Add Cargo */
}

/* Document Number styling */
.doc-number-title {
    margin: 0 0 6px 0;
    padding: 6px 12px;
    text-align: left;
    color: #8ab4ff;
    /* Soft blue accent for dark mode */
    font-size: 16px;
    font-weight: 600;
    
}

.doc-header-block {
        font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: left;
    width: 100%;
    gap: 12px;
}

.view-selected-btn {
    white-space: nowrap;
}

html,
body {
    background: #121212 !important;
    color: #e6e6e6 !important;
}
.container,
.content-area,
.page-wrapper,
.main-wrapper {
    background: #121212 !important;
    color: #e6e6e6 !important;
}

/* Button styling */
.view-selected-btn {
    font-size: 14px;
    white-space: nowrap;
    background: #2a2a2a;
    /* Dark button */
    color: #ffffff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 10px;
}

.view-selected-btn:hover {
    background: #333;
    border-color: #777;
}

/* ------------------------------
   H0 - Search by cargo name Table (Dark Mode)
------------------------------ */
.table-h0-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
    background-color: #1e1e1e;
    /* Dark background */
    color: #e6e6e6;
    /* Light text */
}

/* Header + Cell styling */
.table-h0-style th,
.table-h0-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #444;
    /* Softer dark divider */
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
}

/* Header background for contrast */
.table-h0-style th {
    background-color: #2a2a2a;
    color: #ffffff;
    border-bottom: 1px solid #555;
}

/* Optional: make ID and checkbox columns narrower */
.table-h0-style :is(th, td):nth-child(2),
.table-h0-style :is(th, td):nth-child(3),
.table-h0-style :is(th, td):nth-child(4) {
    width: 20%;
    text-align: center;
}

.table-h0-style :is(th, td):nth-child(1) {
    width: 10%;
    text-align: center;
}

.table-h0-style :is(th, td):nth-child(5) {
    width: 30%;
    text-align: center;
}

/* Hover effect for better UX */
.table-h0-style tr:hover td {
    background-color: #333;
}
/* ------------------------------
   H1 - Search by cargo name Table — DARK MODE
------------------------------ */
.table-h1-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
    background: #1e1e1e;
    /* dark base */
    color: #e6e6e6;
}

.table-h1-style th,
.table-h1-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #333;
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    background: #1e1e1e;
}

/* Narrower columns */
.table-h1-style :is(th, td):nth-child(1),
.table-h1-style :is(th, td):nth-child(2),
.table-h1-style :is(th, td):nth-child(3),
.table-h1-style :is(th, td):nth-child(4),
.table-h1-style :is(th, td):nth-child(5),
.table-h1-style :is(th, td):nth-child(7),
.table-h1-style :is(th, td):nth-child(8),
.table-h1-style :is(th, td):nth-child(9),
.table-h1-style :is(th, td):nth-child(10) {
    width: 7%;
}

.table-h1-style :is(th, td):nth-child(6) {
    width: 37%;
}

/* ⭐ Lighter hover */
.table-h1-style tbody tr:hover td {
    background: #2f3540 !important;
    border-color: #4a6a8a;
}

/* Selected row (distinct from hover) */
.table-h1-style tr.selected td {
    background: #3a4757 !important;
}
/* ------------------------------
   H2 Table
------------------------------ */

/*/ scroll/*/

.table-h2-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
}

.table-h2-style th,
.table-h2-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #ccc;
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
}

/* Optional: make ID and checkbox columns narrower */
.table-h2-style :is(th, td):nth-child(1) {
    width: 30%;
    text-align: center;
}

.table-h2-style :is(th, td):nth-child(2) {
    width: 70%;
    text-align: center;
}

/* ------------------------------
   H3 Table
------------------------------ */
.table-h3-style {
    border-collapse: collapse;
    /* table-layout: auto; */
    width: auto !important;
}

.table-h3-style th,
.table-h3-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #ccc;
    text-align: center;
    white-space: nowrap;
    min-width: 40px;
}
/* 
.table-h3-style :is(th, td):nth-child(1),
.table-h3-style :is(th, td):nth-child(2),
.table-h3-style :is(th, td):nth-child(3),
.table-h3-style :is(th, td):nth-child(5),
.table-h3-style :is(th, td):nth-child(6),
.table-h3-style :is(th, td):nth-child(7),
.table-h3-style :is(th, td):nth-child(8),
.table-h3-style :is(th, td):nth-child(9),
.table-h3-style :is(th, td):nth-child(10) {
    width: 10%;
    text-align: center;
} */


.readonly-field {
    background: #eee;
    border: 1px solid #ccc;
    width: 95%;
    text-align: center;
}



/* ==================================================
   📊 Table H4 Style – Compact Preview Tables
   ================================================== */
/*/ scroll/*/
/* ============================
   H4 SCROLL CONTAINER — DARK MODE
============================ */
.table-h4-scroll-container {
    width: 100%;
    overflow-x: visible !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;

    background: #1e1e1e;
    /* Dark container */
    border: 1px solid #444;
    /* Soft dark border */
    border-radius: 6px;
}

.table-h4-scroll-container table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

/* Sticky header */
.table-h4-scroll-container thead th {
    position: sticky;
    top: 0;
    background: #2a2a2a;
    /* Dark header */
    color: #ffffff;
    z-index: 5;
    border-bottom: 1px solid #555;
}

/* ============================
   H4 TABLE STYLE — DARK MODE
============================ */
.table-h4-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
}

.table-h4-style th,
.table-h4-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #333;
    /* Soft divider */
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    color: #e6e6e6;
    /* Light text */
    background: #1e1e1e;
    /* Match container */
}

/* Optional: column width rules */
.table-h4-style :is(th, td):nth-child(1),
.table-h4-style :is(th, td):nth-child(2),
.table-h4-style :is(th, td):nth-child(3),
.table-h4-style :is(th, td):nth-child(5),
.table-h4-style :is(th, td):nth-child(6),
.table-h4-style :is(th, td):nth-child(7) {
    width: 5%;
    text-align: center;
}

.table-h4-style :is(th, td):nth-child(4),
.table-h4-style :is(th, td):nth-child(8) {
    width: 15%;
    text-align: center;
}

.table-h4-style :is(th, td):nth-child(9) {
    width: 40%;
    text-align: center;
}
/* ==================================================
   📊 Table H6 Style – Compact Preview Tables
   ================================================== */
.table-h6-style {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Base cell styling */
.table-h6-style th,
.table-h6-style td {
    font-size: 14px;
    ;
    padding: 2px 4px;
    color: #000;
    border-bottom: 1px solid #ccc;
    word-break: break-word;
}

/* Optional: make specific columns narrower and centered */
.table-h6-style :is(th, td):nth-child(1),
.table-h6-style :is(th, td):nth-child(2),
.table-h6-style :is(th, td):nth-child(5),
.table-h6-style :is(th, td):nth-child(6),
.table-h6-style :is(th, td):nth-child(7),
.table-h6-style :is(th, td):nth-child(8),
.table-h6-style :is(th, td):nth-child(9),
.table-h6-style :is(th, td):nth-child(10),
.table-h6-style :is(th, td):nth-child(11) {
    width: 6%;
    text-align: left;
}

.table-h6-style :is(th, td):nth-child(3) {
    width: 36%;
    text-align: left;
}

.table-h6-style :is(th, td):nth-child(4) {
    width: 10%;
    text-align: center;
}

/* ==================================================
   🏷️ Form Labels
   ================================================== */
label {
    display: block;
    margin: 0.5rem 0 0.25rem;
    font-weight: bold;
}

/* ==================================================
   🔽 Collapsible Sections
   ================================================== */
.collapsible {
    width: 100%;
    background: #004b6b;
    color: #fff;
    cursor: pointer;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    outline: none;
    font-size: 14px;
    ;
    font-weight: bold;
    border-radius: 6px;
    margin-top: 1rem;
}

.collapsible.active {
    background: #006d94;
}

.content {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 0.5rem;
    background: #fafafa;
}

/* ==================================================
   📋 Select Dropdown
   ================================================== */
select {
    width: 100%;
    padding: 0.5rem;
    font-size: 14px;
    ;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ==================================================
   🔍 Preview Panel
   ================================================== */
#previewPanel table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 1rem;
}

#previewPanel th,
#previewPanel td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    word-break: break-word;
}

#previewPanel th {
    background-color: #f7f7f7;
    min-width: 150px;
    font-weight: normal;
}

#previewPanel td {
    background-color: #fff;
}

/* ==================================================
   🧏 Screen Reader Accessibility
   ================================================== */
.screen-reader-text {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    /* font-size: 14px;; */
    font-size: 14px;
    /* overflow: auto; */
}

/* ==================================================
   💾 Form Actions
   ================================================== */
.form-actions {
    margin-top: 1rem;
    /* font-size: 12px; */
    /* display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: right; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    padding: 1rem 0;
}

/* ==================================================
   🧵 Buttons
   ================================================== */
.btn {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-left: 0.5rem;
}

.btn.save {
    background-color: #004b6b;
    color: #fff;
}

.btn.save:hover {
    background-color: #2ed73f;
}

.btn.freq {
    background-color: #004b6b;
    color: #fff;
}

.btn.freq:hover {
    background-color: #0a2dc8;
}

.btn.clear {
    background-color: #004b6b;
    color: #fff;
}

.btn.clear:hover {
    background-color: #a63712;
}

.btn.next {
    background-color: #004b6b;
    color: #fff;
}

.btn.next:hover {
    background-color: #6e07ec;
}

.btn.proceed {
    background-color: #004b6b;
    color: #fff;
}

.btn.proceed:hover {
    background-color: #2ed73f;
}

.btn.danger {
    background-color: #004b6b;
    color: #fff;
}

.btn.danger:hover {
    background-color: #e37340;
}

.btn.export {
    background-color: #004b6b;
    margin-right: 20px;
    color: #fff;
}

.btn.export:hover {
    background-color: #f8087c;
}

.btn.form {
    background-color: #004b6b;
    color: #fff;
}

.btn.form:hover {
    background-color: #2ed73f;
}

.btn:hover {
    opacity: 0.9;
}

/* ==================================================
   🗑️ Delete Button
   ================================================== */
.delete-record-btn {
    background-color: #004b6b;
    color: #ffffff;
    border: none;
    padding: 0.2em 0.3em;
    border-radius: 5px;
    font-size: 14px;
    ;
    font-weight: 100;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.1em;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.delete-record-btn:hover {
    background-color: #d32f2f;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15);
}

.delete-record-btn:focus {
    outline: 2px solid #d32f2f;
    outline-offset: 2px;
}

.icon-delete {
    display: inline-block;
    vertical-align: middle;
    fill: #fff;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    padding: 1rem 0;
}
.navigation-buttons {
    margin-bottom: 6px;
    /* reduce space below Add Cargo */
}

.navigation-buttons .btn {
    margin: 0;
    /* remove default button margin */
}

.collapsible {
    margin-top: 0;
    /* remove space above Cargo Details */
}
.nav-btn {
    padding: 0.3rem 1rem;
    font-size: 14px;
    font-weight: 300;
    color: #121111;
    background-color: #bdee1b;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
    background-color: #00e62a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.back-btn,
.next-btn {
    margin: 0;
}

.form-title {
    text-align: center;
    color: #141313;
    font-size: 14px;
    margin-bottom: 0.5rem;
    font-weight: bold;
    white-space: normal;
}


select.inner-code {
    width: 100%;
    /* padding: clamp(4px, 0.6vw, 10px) clamp(6px, 1vw, 14px); */
    font-size: 14px;
    ;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #fff;
    line-height: 1.2;
    transform-origin: top left;
    appearance: none;
    /* cleaner look */
}

/* Ensure printable form fits page width */

/* ==================================================
   📄 Text Wrapping & Page Breaks
   ================================================== */
#printableForm {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
    font-size: 14px;
    transform-origin: top left;
}

/* Tables should auto-fit and wrap content */
#printableForm table {
    width: 100%;
    table-layout: fixed;
    /* Forces equal column widths */
    border-collapse: collapse;
}

#printableForm th,
#printableForm td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    vertical-align: top;
    padding: 0.4rem;
    font-size: 14px;
    line-height: 1.2;
    box-sizing: border-box;
}

/* Prevent content from overflowing container */
#printableForm * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Optional: force page breaks between sections */
.page-break {
    page-break-before: always;
}

/* Optional: read-only field styling */
textarea[readonly],
input[readonly] {
    background-color: #eee;
    color: #333;
    cursor: not-allowed;
}


/* ==================================================
   🔘 Action Buttons
   ================================================== */

.btn.preview {
    background-color: #888;
}

.btn.preview:hover {
    background-color: #666;
}



/* ==================================================
   🔒 Read-only Field Styling
   ================================================== */
textarea[readonly],
input[readonly] {
    background-color: #eee;
    color: #333;
    cursor: not-allowed;
}

/* ==================================================
   📜 Declaration Sections
   ================================================== */
.declaration-box,
.declaration {
    background-color: #f9f9f9;
    padding: 0.5rem;
    font-size: 14px;
    ;
    ;
    border: 1px solid #ccc;
    margin-top: 0.5rem;
}

/* ==================================================
   🟢 Session Indicator
   ================================================== */
.session-indicator {
    background-color: #e6f4ea;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ==================================================
   🔄 Reset Button
   ================================================== */
.reset-button {
    background-color: #f44336;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 1rem;
}

.reset-button:hover {
    background-color: #d32f2f;
}

/* ==================================================
   🛡️ HazShield Main Page
   ================================================== */
.hazshield-main-page {
    padding: 2rem;
    font-size: 14px;
    ;
    line-height: 1.0;
    background-color: #f9f9f9;
    border-radius: 8px;
    max-width: 800px;
    margin: 2rem auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.hazshield-main-page a {
    color: #0073aa;
    font-weight: bold;
    text-decoration: underline;
}

/* ==================================================
   📣 Status Message
   ================================================== */
#saveStatus {
    margin-top: 1rem;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

/* ==================================================
   📱 Responsive Scroll Containers
   ================================================== */
/* ==================================================
   DARK MODE — Containers
================================================== */
#variantTableContainer,
#GoodsDescContainer,
#idPairsContainer,
#previewPanel {
    width: 100%;
    margin: 0;
    padding: 1rem 0;
    box-sizing: border-box;

    overflow-x: visible !important;
    overflow-y: visible !important;

    justify-content: center;
    max-height: none !important;
    height: auto !important;
    display: block !important;

    background: #1e1e1e;
    /* Dark background */
    color: #e6e6e6;
    /* Light text */
}

.container,
.content-area {
    max-width: 100vw;
    margin: 0;
    padding: 0;
    background: #1e1e1e;
    color: #e6e6e6;
}

/* ==================================================
   Highlighted UNNO rows
================================================== */
.highlight-unno {
    background-color: #5a4b00;
    /* Dark-mode amber highlight */
    font-weight: bold;
    transition: background-color 0.3s ease;
}

/* ==================================================
   Cargo block text
================================================== */
.cargo-block {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 12px;
    padding: 4px;

    border-bottom: 1px dashed #555;
    /* Dark dashed divider */
    page-break-inside: avoid;
    color: #e6e6e6;
}

/* ==================================================
   Column width rules
================================================== */
#cargoTable th:nth-child(3),
#cargoTable td:nth-child(3),
#idPairsTable th:nth-child(9),
#idPairsTable td:nth-child(9) {
    min-width: 200px;
}

/* Compatibility Summary column */
#idPairsTable td.compatibility-summary,
#idPairsTable th:nth-child(10) {
    width: 260px;
    max-width: 260px;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
}

/* ==================================================
   Search Inputs & Dropdowns — DARK MODE
================================================== */
#searchUNPSN,
#UNNO {
    width: 100%;
    padding: 1.2rem;
    margin: 0.5rem 0 1rem;

    border: 1px solid #555;
    border-radius: 4px;

    font-size: 14px;
    box-sizing: border-box;

    background: #2a2a2a;
    color: #ffffff;
}

#UNNO[size] {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* ==================================================
   Table wrapper
================================================== */
.table-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: visible !important;
    background: #1e1e1e;
}

/* 🖼️ Preview Panel */
#previewPanel {
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 20px;
    background-color: #fdfdfd;
    border-radius: 6px;
}

#previewPanel h4 {
    margin-top: 0;
    font-size: 14px;
    ;
    color: #333;
}

#previewPanel table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#previewPanel th,
#previewPanel td {
    border: 1px solid #eee;
    padding: 6px 10px;
    font-size: 14px;
    ;
}

#previewPanel th {
    background-color: #f9f9f9;
    width: 200px;
    font-weight: normal;
    color: #555;
}

/* 🎨 Buttons (optional if you add them later) */
button.btn {
    padding: 4px 7px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button.confirm {
    background-color: #4CAF50;
    color: white;
}

button.clear {
    background-color: #f44336;
    color: white;
}


.imdg-user-menu,
.imdg-guest-menu {
    margin-bottom: 20px;
    background: #f8f8f8;
    padding: 10px;
    border-radius: 6px;
}

.imdg-user-menu ul,
.imdg-guest-menu ul {
    display: flex;
    gap: 15px;
    list-style: none;
}

.flash-missing {
    border: 2px solid red !important;
    background-color: #ffe6e6;
}

.flash-warning {
    position: relative;
}

.flash-warning::after {
    content: "⚠️";
    color: #d9534f;
    font-size: 14px;
    ;
    position: absolute;
    right: -22px;
    top: 50%;
    transform: translateY(-50%);
}

#package_description {
    white-space: pre-wrap;
    font-family: monospace;
    min-height: 300px;
}

#package_description_display {
    font-size: 14px;
    ;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* font-family: inherit; */
    padding: 8px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    white-space: pre-wrap;
    font-family: monospace;
    line-height: 1.4;
}

#searchCargoName {
    width: 300px;
    /* wider box */
    height: 40px;
    /* taller box */
    font-size: 14px;
    ;
    /* larger text inside the box */
    padding: 8px 12px;
    /* comfortable spacing */
}

#save-button {
    background-color: #007bff;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    ;
    cursor: pointer;
}

#save-button:hover {
    background-color: #0056b3;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 18px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    ;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

/* ==================================================
   🎨 Multimodal Form Styles — DARK MODE
   ================================================== */

.multimodal-form {
    max-width: 100vw;
    margin: 1rem auto;
    padding: 1rem;
    font-family: Arial, sans-serif;
    font-size: 14px;

    background: #1e1e1e;
    /* Dark background */
    color: #e6e6e6;
    /* Light text */
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

/* Title */
.CSform-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffffff;
}

/* ============================================================
   FORM SECTIONS
============================================================ */
.form-section {
    padding: 5px 0;
    border-bottom: 1px solid #000000;
    /* Dark divider */
    page-break-inside: avoid;
}

.form-section h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
}

/* ============================
   FLUID LABEL FONT SCALING
   ============================ */
#form-section label {
    font-size: 14px;
    line-height: 1.2;
    display: inline-block;
    transform-origin: top left;
    color: #000000;
}

/* Optional: subtle hover highlight for inputs */
.multimodal-form input:hover,
.multimodal-form select:hover,
.multimodal-form textarea:hover {
    background-color: #2a2a2a;
}
/* ============================================================
   GRID SYSTEM
============================================================ */
.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    font-size: 14px;
    gap: 10px;
    grid-auto-rows: auto !important;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    font-size: 14px;
    ;
}

.span-2 {
    grid-column: span 2;
}

/* ============================================================
   PAGE BREAK CONTROL
============================================================ */
.avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
}

.page-break {
    page-break-before: always;
    break-before: page;
}

/* ============================================================
   SPECIAL ELEMENTS
============================================================ */
#package_description {
    font-size: 14px;
    ;
    line-height: 1.45;
}

.cargo-description {
    white-space: pre-wrap;
    border: 1px solid #444;
    background: #fafafa;
    word-break: break-word;
    display: block;
    width: 100%;
    min-height: 150px;
    font-size: 14px;
    ;
    line-height: 1.3;
    padding: 4px;
    box-sizing: border-box;
}

/* ============================================================
   PRINT OPTIMIZATION FOR html2pdf
============================================================ */
@media print {
    .form-section {
        page-break-inside: avoid;
    }

    .avoid-break {
        page-break-inside: avoid !important;
    }

    .page-break {
        page-break-before: always !important;
    }
}

/* ============================
   MODAL OVERLAY
============================ */
.freq-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================
   MODAL CONTENT (NO SCROLL)
============================ */
.freq-modal-content {
    background: #004080;
    color: #fff;
    width: 80%;
    /* Remove height limits */
    max-height: none;
    height: auto;

    /* Remove all scroll behavior */
    overflow: visible;

    border-radius: 8px;
    padding: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Remove scrollbar styling entirely */
.freq-modal-content::-webkit-scrollbar,
.freq-modal-content::-webkit-scrollbar-thumb,
.freq-modal-content::-webkit-scrollbar-thumb:hover {
    display: none;
}

/* ============================
   MODAL HEADER (Sticky)
============================ */
.freq-modal-header {
    padding: 20px;
    background: #004080;
    border-bottom: 2px solid #003366;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.freq-title {
    font-size: 14px;
    ;
    font-weight: bold;
}

.freq-close {
    font-size: 14px;
    ;
    font-weight: bold;
    cursor: pointer;
    color: #ffcc00;
}

/* ============================
   MODAL BODY (NO SCROLL)
============================ */
.freq-modal-body {
    padding: 20px;
    background: #1e1e1e;
    overflow: visible;
    /* ensure no scroll */
}

/* ============================
   FILTER INPUT
============================ */
#freq-filter {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    ;
}
/* ============================
   SCROLL CONTAINER — DARK MODE
============================ */
.table-scroll-container {
    width: 100%;
    overflow-x: visible !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;

    background: #1e1e1e;
    /* Dark background */
    border: 1px solid #444;
    /* Softer dark border */
    border-radius: 6px;
}

.table-scroll-container table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

/* Sticky header in dark mode */
.table-scroll-container thead th {
    position: sticky;
    top: 0;
    background: #2a2a2a;
    /* Dark header background */
    color: #ffffff;
    /* High-contrast text */
    z-index: 5;
    border-bottom: 1px solid #555;
}
/* ============================
   SCROLL CONTAINERS — DARK MODE
============================ */
.table-scroll-containers {
    max-height: 380px;
    width: 100%;
    overflow-x: visible !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    background: #1e1e1e;
    /* Dark background */
    border: 1px solid #444;
    /* Soft dark border */
    border-radius: 6px;
}

.table-scroll-containers table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

/* Sticky header */
.table-scroll-containers thead th {
    position: sticky;
    top: 0;
    background: #2a2a2a;
    /* Dark header */
    color: #ffffff;
    /* High contrast text */
    z-index: 5;
    border-bottom: 1px solid #555;
}

/* Disable text selection and caret */
.no-focus-table td,
.no-focus-table th {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    caret-color: transparent;
    /* Hide blinking cursor */
}

/* Remove focus outline */
.no-focus-table td:focus,
.no-focus-table th:focus {
    outline: none;
}

/* Prevent inner elements from stealing focus */
.no-focus-table td *,
.no-focus-table th * {
    pointer-events: none;
}

/* Base table */
.table-h11-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
    background: #1e1e1e;
    /* Dark base */
    color: #e6e6e6;
}

.table-h11-style th,
.table-h11-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #444;
    /* Dark divider */
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    background: #1e1e1e;
}

/* Narrow columns */
.table-h11-style :is(th, td):nth-child(1),
.table-h11-style :is(th, td):nth-child(2),
.table-h11-style :is(th, td):nth-child(3),
.table-h11-style :is(th, td):nth-child(4),
.table-h11-style :is(th, td):nth-child(5),
.table-h11-style :is(th, td):nth-child(7),
.table-h11-style :is(th, td):nth-child(8),
.table-h11-style :is(th, td):nth-child(9),
.table-h11-style :is(th, td):nth-child(10),
.table-h11-style :is(th, td):nth-child(11),
.table-h11-style :is(th, td):nth-child(12),
.table-h11-style :is(th, td):nth-child(13),
.table-h11-style :is(th, td):nth-child(14),
.table-h11-style :is(th, td):nth-child(15),
.table-h11-style :is(th, td):nth-child(16) {
    width: 4%;
}

.table-h11-style :is(th, td):nth-child(6),
.table-h11-style :is(th, td):nth-child(17) {
    width: 20%;
    text-align: left;
}

/* Sortable header */
.table-h11-style th.sortable {
    cursor: pointer;
    background: #2a2a2a;
    color: #ffffff;
    user-select: none;
}

.table-h11-style th.sortable:hover {
    background: #3a3a3a;
    /* Slightly lighter */
}

/* ⭐ Row hover — lighter shade */
.table-h11-style tbody tr:hover td {
    background: #2f3540 !important;
    /* Lightened dark shade */
    border-color: #4a6a8a;
    /* Soft blue-grey highlight */
}

/* Selected row */
.table-h11-style tr.selected td {
    background: #3a4757 !important;
    /* Distinct from hover */
}

/* ============================
   MOBILE RESPONSIVENESS
============================ */
@media (max-width: 600px) {

    #freq-cargo-table th,
    #freq-cargo-table td {
        white-space: normal;
        /* allow wrapping */
        padding: 8px;
        font-size: 14px;
    }
}
#freq-cargo-table th.sortable:hover {
    background-color: #c9d466;
    cursor: pointer;
    color: #005bbb;
}

/* ============================
   CHECKBOX
============================ */
input.freq-select {
    cursor: pointer;
}

/* Pagination text */
.freq-pagination .freq-page-info {
    color: #040404;
}

/* ============================
============================ */

#lqErrorSummary {
    background: #d50000;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-weight: bold;
    font-size: 14px;
    ;
    white-space: pre-line;
}

/* Red row highlight */
.lq-error {
    border: 2px solid #d50000 !important;
    background: #ffebee !important;
}

/* Tooltip container */
.lq-error-tooltip {
    position: relative;
}

/* Flicker‑proof tooltip */
.lq-error-tooltip:hover::after {
    content: attr(data-error);
    position: fixed;
    /* ⭐ prevents layout shift → no flicker */
    left: 20px;
    top: 20px;
    background: #d50000;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 14px;
    ;
    z-index: 99999;
    pointer-events: none;
}

#lqErrorSummary {
    background: #d50000;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-weight: bold;
    font-size: 14px;
    ;
    white-space: pre-line;
}

/* ==================================================
   📊 Table H7 Style – Compact Preview Tables
   ================================================== */

/* Base table */
.table-h7-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
    background: #1a1a1a;
    /* dark base */
    color: #e6e6e6;
}

/* Header + cell styling */
.table-h7-style th,
.table-h7-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #333;
    /* dark divider */
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    background: #1a1a1a;
    /* dark background */
    color: #e6e6e6;
}

/* Header background */
.table-h7-style th {
    background: #2a2a2a;
    /* darker header */
    font-weight: 600;
}

/* Hover effect */
.table-h7-style tbody tr:hover td {
    background: #2f3540 !important;
    /* lighter hover */
    border-color: #4a6a8a;
    /* soft blue-grey highlight */
}

/* Selected row (if used) */
.table-h7-style tr.selected td {
    background: #3a4757 !important;
}

/* Column width rules preserved exactly */
.table-h7-style :is(th, td):nth-child(1),
.table-h7-style :is(th, td):nth-child(2),
.table-h7-style :is(th, td):nth-child(5),
.table-h7-style :is(th, td):nth-child(6),
.table-h7-style :is(th, td):nth-child(7),
.table-h7-style :is(th, td):nth-child(8),
.table-h7-style :is(th, td):nth-child(9),
.table-h7-style :is(th, td):nth-child(10),
.table-h7-style :is(th, td):nth-child(11),
.table-h7-style :is(th, td):nth-child(12),
.table-h7-style :is(th, td):nth-child(13),
.table-h7-style :is(th, td):nth-child(14),
.table-h7-style :is(th, td):nth-child(15) {
    width: 6%;
    text-align: center;
}

.table-h7-style :is(th, td):nth-child(3) {
    width: 15%;
    text-align: center;
}

.table-h7-style :is(th, td):nth-child(4) {
    width: 7%;
    text-align: center;
}

/* Input fields inside table */
.table-h7-style input.neq,
.table-h7-style input.tech-name,
.table-h7-style input.FP-declared,
.table-h7-style input.inner-qty,
.table-h7-style input.inner-count,
.table-h7-style input.outer-count {
    font-size: 14px;
    line-height: 1.2;
    padding: 2px 4px;
    height: auto;
    text-align: center;

    background: #1a1a1a;
    color: #e6e6e6;
    border: 1px solid #333;
    border-radius: 3px;
}

/* Select fields */
.table-h7-style select.inner-code,
.table-h7-style select.inner-unit,
.table-h7-style select.outer-type {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 14px;
    line-height: 1.2;
    padding: 2px 4px;
    height: auto;
    text-align-last: center;

    background: #1a1a1a;
    color: #e6e6e6;
    border: 1px solid #333;
    border-radius: 3px;
}

.lq-error-row {
    background-color: #ffdddd !important;
    border-left: 4px solid #d9534f;
}

.signature-field,
.signature-wrapper {
    border: 1px solid #333;
    width: auto;
    height: 150px;
    position: relative;
    background: #fff;
    margin-top: 8px;
}

#signature-pad {
    width: 100%;
    height: 100%;
}

#clear-signature {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 4px 8px;
    font-size: 14px;
    ;
}

.signature-preview img {
    max-width: 200px;
    margin-top: 10px;
    border: 1px solid #ccc;
}

#autosave-indicator {
    position: fixed;
    top: 15px;
    right: 20px;
    background: #0078d4;
    color: #fff;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

[data-disabled="1"] {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

[data-disabled="1"] {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.freq-highlight {
    background-color: #fff3cd !important;
    transition: background-color 0.2s ease;
}

.error-border {
    border: 1px solid red !important;
}

.mandatory-cell {
    background-color: #ffe6e6 !important;
    /* soft red highlight */
    border: 2px solid #ff4d4d !important;
}

.error-border {
    border: 1px solid red !important;
}

.container-seg-heading {
    font-size: 18px;
    font-weight: 600;

    color: #8ab4ff;
    /* Soft blue for dark mode text */
    margin: 25px 0 10px;
    padding: 8px 12px;

    background: #1e1e1e;
    /* Dark background */
    border-left: 4px solid #8ab4ff;
    /* Matching accent bar */
    border-radius: 4px;
}




.planner-container-row {
    display: flex;
    align-items: center;
    gap: 12px;
    /* space between label and input */
    margin-bottom: 12px;
}

.planner-container-row label {
    white-space: nowrap;
    /* prevents label from breaking into two lines */
    font-size: 14px;
}

.planner-container-row input[type="number"] {
    width: 120px;
    /* clean compact width */
    padding: 6px;
    font-size: 14px;
}
/* ============================
   CARGO FILTER BAR — DARK MODE
============================ */
.cargo-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 10px 12px;

    background: #1e1e1e;
    /* Dark background */
    border: 1px solid #444;
    /* Soft dark border */
    border-radius: 6px;
    color: #e6e6e6;
    /* Light text */
}

.cargo-filter-bar select {
    padding: 6px 10px;
    border: 1px solid #555;
    /* Darker border */
    border-radius: 4px;
    font-size: 14px;

    background: #2a2a2a;
    /* Dark dropdown */
    color: #ffffff;
    /* High contrast text */
}

/* Optional hover for better UX */
.cargo-filter-bar select:hover {
    background: #333;
}
/* Saved indicator */


.haz-debug-badge {
    font-size: 10px;
    color: #555;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-block;
    /* float: right; */
}

/* ================================
   SHIPMENT TABLE — PERFECT ALIGNMENT
   ================================ */
/* ================================
   SHIPMENT TABLE — PERFECT ALIGNMENT
   ================================ */
/* ============================
   SHIPMENT TABLE WRAPPER — DARK MODE
============================ */
.shipment-table-wrapper {
    width: 100%;
    border: 1px solid #444;
    /* Dark border */
    overflow-x: auto;
    background: #1e1e1e;
    /* Dark container background */
}

/* Core table layout */
.shipment-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Critical for alignment */
    font-size: 14px;
    color: #e6e6e6;
    /* Light text */
}

/* Header styling */
.shipment-table thead th {
    background: #2a2a2a;
    /* Dark header */
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid #555;
    /* Stronger divider */
    white-space: nowrap;
    color: #ffffff;
}

/* Body cells */
.shipment-table tbody td {
    padding: 8px;
    border-bottom: 1px solid #333;
    /* Soft row divider */
    vertical-align: middle;
    background: #1e1e1e;
    /* Match wrapper */
}

/* Hover highlight */
.shipment-table tbody tr:hover td {
    background: #2f3540;
    /* Subtle blue‑grey hover */
    border-color: #4a6a8a;
    /* Soft highlight */
}

/* Inputs + selects */
.shipment-table input,
.shipment-table select {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: #ffffff;
    box-sizing: border-box;
}

/* Read-only fields */
.shipment-table input[readonly] {
    background: #3a3a3a;
    color: #bbbbbb;
    cursor: default;
}

/* Column widths — shared by header + body */
.col-id {
    width: 120px;
}

.col-size {
    width: 140px;
}

.col-iso {
    width: 120px;
}

.col-desc {
    width: 180px;
}

.col-seal {
    width: 120px;
}

.col-tare {
    width: 120px;
}

.col-gross {
    width: 150px;
}

/* Optional: subtle row rounding */
.shipment-table tbody tr td:first-child {
    border-left: 1px solid transparent;
}

.shipment-table tbody tr td:last-child {
    border-right: 1px solid transparent;
}
.badge-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: #f7f7f7;
    border-radius: 6px;
    border: 1px solid #ddd;
    min-height: 40px;
    max-height: 200px;
    overflow-y: auto;
}

.badge-box.readonly {
    pointer-events: none;
    /* fully read‑only */
    user-select: text;
    /* allow copying */
}

.badge {
    background: #f4f5f7;
    color: #000000;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    width: fit-content;
    line-height: 1.3;
}
/* ================================
   Add Selection Button
   ================================ */
#saveUNRecords {
    background: #1a4d8f;
    /* Microsoft blue */
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Hover state (enabled only) */
#saveUNRecords:hover:not(:disabled) {
    background: #1a4d8f;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Disabled state (locked by SP logic) */
#saveUNRecords:disabled {
    background: #c8c8c8;
    color: #666666;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.75;
}

/* ////////////////////// */

#idPairsTable {
    width: auto;
    max-width: 100vw;
    table-layout: auto;
    border-collapse: collapse;
    margin: 2rem auto;
    /* overflow-x: scroll; */
    overflow-x: visible !important;
    /* width: auto; */
}

/* Table cells styling */

#idPairsTable th,
#idPairsTable td {
    border: 1px solid #ccc;
    padding: 0.4rem;
    /* Slightly increased for readability */
    text-align: center;
    font-size: 14px;
    ;
    word-break: break-word;
    white-space: nowrap;
    /* Prevents wrapping unless needed */
}

/* Header styling */

#idPairsTable th {
    background-color: #f0f8ff;
    font-size: 14px;
    ;
    color: #003366;
}


/* ////////////////////// */
/* ============================================================
   Hover highlight — DARK MODE
============================================================ */
#freq-cargo-table tbody tr:hover {
    background-color: #36382a;
    /* soft dark hover */
    cursor: pointer;
}

#freq-cargo-table tbody tr:hover:not(.selected-row) {
    background-color: #3f4332;
}

/* ============================================================
   Base table layout — DARK MODE
============================================================ */
#variantTable,
#freq-cargo-table {
    width: auto;
    max-width: 100vw;
    table-layout: auto;
    border-collapse: collapse;
    margin: 2rem auto;
    overflow-x: visible !important;
    background: #1e1e1e;
    /* dark table background */
    color: #e6e6e6;
}

/* ============================================================
   Table cells — DARK MODE
============================================================ */
#variantTable th,
#variantTable td,
#freq-cargo-table th,
#freq-cargo-table td {
    border: 1px solid #444;
    /* dark border */
    padding: 0.4rem;
    text-align: center;
    font-size: 14px;
    word-break: break-word;
    white-space: nowrap;
    background: #1e1e1e;
    color: #e6e6e6;
}

/* ============================================================
   Header styling — DARK MODE
============================================================ */
#variantTable th,
#freq-cargo-table th {
    background-color: #2a2a2a;
    /* dark header */
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid #555;
}

/* ============================================================
   Prevent text selection — DARK MODE
============================================================ */
#variantTable td,
#freq-cargo-table td {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    caret-color: transparent;
}

#variantTable td:focus {
    outline: none;
}

/* ============================================================
   Selected row — DARK MODE
============================================================ */
#variantTable tr.selected,
#freq-cargo-table tr.selected {
    background-color: #3a4757;
    /* muted blue-grey */
}

/* ============================================================
   First column alignment
============================================================ */
#variantTable td:first-child,
#freq-cargo-table td:first-child {
    text-align: center;
    vertical-align: middle;
}

/* ============================================================
   Checkbox scaling
============================================================ */
.variant-checkbox {
    transform: scale(1.2);
}

/* ============================================================
   Full-width table container — DARK MODE
============================================================ */
#variantTable,
#freq-cargo-table {
    width: 100vw;
    margin: 0;
    table-layout: auto;
    border-collapse: collapse;
    height: auto !important;
}

/* ============================================================
   Final cell styling override — DARK MODE
============================================================ */
#variantTable th,
#variantTable td,
#freq-cargo-table th,
#freq-cargo-table td {
    border: 1px solid #555;
    padding: 8px;
    text-align: left;
    background: #1e1e1e;
    color: #e6e6e6;
}

/* ============================================================
   Header final override — DARK MODE
============================================================ */
#variantTable th,
#freq-cargo-table th {
    background-color: #2a2a2a;
    font-weight: bold;
}

/* ============================================================
   Even row striping — DARK MODE
============================================================ */
#variantTable tr:nth-child(even),
#freq-cargo-table tr:nth-child(even) {
    background-color: #969595;
}

/* ============================================================
   Hover highlight final — DARK MODE
============================================================ */
#variantTable tr:hover,
#freq-cargo-table tr:hover {
    background-color: #2f3540;
}


#shipper_full,
#consignee_full {
    overflow: hidden;
    resize: none;
    min-height: 60px;
    width: 100%;
    line-height: 1.3;
    padding: 6px 8px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #000;
}

#printableForm #shipper_full_display {
    border: 1px solid #000;
    padding: 6px 8px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

#printableForm .print-text {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    display: none;
}



#printableForm #consignee_full_display {
    border: 1px solid #000;
    padding: 6px 8px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    display: none;
}

.summary-style-box {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    background: #f9f9f9;
    border: 1px solid #000;
    border-radius: 6px;
    font-family: "Courier New", monospace;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    resize: none;
    /* overflow: hidden; */
    /* no scrollbars */
    box-sizing: border-box;
    color: #000000;
}

@media print {
    .summary-style-box {
        display: none !important;
    }

    .summary-display {
        display: block !important;
        white-space: pre-wrap !important;
        line-height: 1.45 !important;
    }
}

.summary-display {
    display: none;
    /* visible only in PDF mode */
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    padding: 12px 14px;
    border: 1px solid #000;
    background: #fff;
    min-height: 90px;
    /* matches textarea */
    box-sizing: border-box;
    overflow: visible !important;
    height: auto !important;
}

#shipping_marks {
    overflow: hidden;
    resize: none;
    min-height: 40px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

#shipping_marks_display {
    display: block !important;
    width: 100% !important;
    min-height: auto !important;

    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;

    border: 1px solid #000;
    padding: 6px 8px;
    box-sizing: border-box;

    overflow: visible !important;
    /* ⭐ critical */
    height: auto !important;
    /* ⭐ critical */
}

.shipping-display {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    border: 1px solid #000;
    padding: 6px 8px;
    box-sizing: border-box;
    display: none;
}

/* ============================================================
   FIELD BLOCKS
============================================================ */

.field label {
    font-weight: bold;
    margin-bottom: 1px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #444;
    border-radius: 3px;
    font-size: 14px;
    ;
    box-sizing: border-box;
}

.field textarea {
    min-height: 70px;
    resize: vertical;
}

.field {
    display: block;
    /* flex-direction: column; */
    /* height: auto !important; */
    /* overflow: visible !important; */
}

.span-1 {
    grid-column: span 1;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.field.no-flex {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.span-1 {
    height: auto !important;
    overflow: visible !important;
}

@media print {

    /* Ensure all grid rows expand naturally */
    .grid-5 {
        grid-auto-rows: auto !important;
    }

    /* Ensure each field grows with its content */
    .field {
        height: auto !important;
    }

    /* Hide textareas in PDF */
    .summary-style-box {
        display: none !important;
    }

    /* Show display divs in PDF */
    .summary-display {
        display: block !important;
        white-space: pre-wrap !important;
        line-height: 1.45 !important;

        /* Prevent clipping or overflow */
        overflow: visible !important;

        /* Allow natural height expansion */
        height: auto !important;
        min-height: 0 !important;
        font-size: 8px !important;
                    /* or 10px, 9px, etc. */
        line-height: 1.35 !important;
                    /* tighter but readable */
    }
}

@media print {
    .force-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }
}

.multiline-input {
    white-space: pre-wrap;
    min-height: 150px;
    padding: 6px;
    line-height: 1.3;
}
.multiline-inputs {
    white-space: pre-wrap;
    min-height: 100px;
    padding: 6px;
    line-height: 1.3;
}

.un-class-psn div,
.tech-product-combined,
/* .inner-combined,
.outer-combined, */
.weight-combined,
.checkbox-combined {
    line-height: 1.3;
}
.small-input {
    height: 20px !important;
    line-height: 20px;
    padding: 2px 6px;
    font-size: 12px;
}
.small-width {
    width: 20px !important;
    /* adjust to your exact requirement */
    min-width: 20px;
}
.lq-row {
    display: flex;
    align-items: center;
    gap: 8px;
    /* spacing between text, checkbox, and SAVED */
}

.lq-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.overpack-row,
.empty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    /* spacing between label, checkbox, SAVED */
}

.overpack-label,
.empty-label {
    display: flex;
    align-items: center;
    gap: 6px;
}


/* ================================
   UNIVERSAL ONE-LINE COMBINED CELL RULES
   ================================ */

/* Prevent wrapping inside all combined TDs */
.tech-product-combined,
/* .inner-combined,
.outer-combined, */
.weight-combined,
.checkbox-combined {
    white-space: nowrap;
}

/* Every block inside these cells stays on one line */
.tech-product-combined>div,
/* .inner-combined>div,
.outer-combined>div, */
.weight-combined > div,
.checkbox-combined > div {
    display: flex;
    display: flex;
        align-items: flex-start;
        gap: 8px;
        white-space: nowrap;
}

/* Special multi-block rows ( LQ-row, Overpack-row, Empty-row) */

.checkbox-combined .lq-row,
.checkbox-combined .overpack-row,
.checkbox-combined .empty-row {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
}

/* Labels containing checkbox + SAVED */
.checkbox-combined .lq-label,
.checkbox-combined .overpack-label,
.checkbox-combined .empty-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ================================
   INPUT + SELECT WIDTH CONTROL
   ================================ */

/* Smaller fields (Inner Qty etc.) */
.small-input {
    width: 60px !important;
    max-width: 60px !important;
}

/* Readonly NEQ field */
.readonly-field {
    width: 120px;
    max-width: 120px;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* ================================
   SAVED + ERROR BADGES
   ================================ */


.inner-qty-error,
.inner-unit-error {
    flex-shrink: 0;
}

/* ================================
   TECH PRODUCT BLOCKS
   ================================ */

/* Allow two rows inside the same column */
.weight-combined {
    white-space: normal;
    /* allow row breaks */
    vertical-align: top;
}

/* ============================================
   MASTER CELL — allows multiple stacked rows
   ============================================ */
.weight-combined {
    white-space: normal;
    vertical-align: top;
    padding: 4px 0;
}

/* ============================================
   ROW WRAPPERS — each row is a left-aligned flex line
   ============================================ */
.weight-combined .inner-row,
.weight-combined .outer-row,
.weight-combined .weight-row,
.weight-combined .flags-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* ============================================
   FIELD BLOCKS — each field stays inline
   ============================================ */
.weight-combined .inner-code-block,
.weight-combined .inner-qty-block,
.weight-combined .inner-unit-block,
.weight-combined .inner-count-block,
.weight-combined .outer-type-block,
.weight-combined .outer-count-block,
.weight-combined .net-weight-block,
.weight-combined .gross-weight-block,
.weight-combined .neq-block,
.weight-combined .lq-block,
.weight-combined .overpack-block,
.weight-combined .empty-uncleaned-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============================================
   INPUT WIDTHS
   ============================================ */
.weight-combined input.auto-input,
.weight-combined select.auto-input {
    width: 60px;
    max-width: 60px;
    box-sizing: border-box;
    flex-shrink: 0;
}


.cont-tiny {
    width: 135px !important;
    max-width: 135px !important;
}
/* ============================================
   READONLY FIELDS
   ============================================ */
.weight-combined .readonly-field {
    width: 60px;
    max-width: 60px;
    flex-shrink: 0;
}

/* ============================================
   BADGES
   ============================================ */
.weight-combined .save-confirm,
.weight-combined .inner-qty-error,
.weight-combined .inner-unit-error {
    flex-shrink: 0;
}


.tech-product-combined {
    border-left: none !important;
}



#savedCargoTable {
    border-collapse: separate !important;
    border-spacing: 0;
}

#savedCargoTable td:nth-child(2),
#savedCargoTable th:nth-child(2) {
    border-right: none !important;
}

#savedCargoTable td:nth-child(3),
#savedCargoTable th:nth-child(3) {
    border-left: none !important;
}

#savedCargoTable td:nth-child(4),
#savedCargoTable th:nth-child(4) {
    border-right: none !important;
}

#savedCargoTable td:nth-child(5),
#savedCargoTable th:nth-child(5) {
    border-left: none !important;
}

#savedCargoTable td:nth-child(6),
#savedCargoTable th:nth-child(6) {
    border-right: none !important;
}

#savedCargoTable td:nth-child(7),
#savedCargoTable th:nth-child(7) {
    border-left: none !important;
}

#savedCargoTable td:nth-child(8),
#savedCargoTable th:nth-child(8) {
    border-right: none !important;
}

#savedCargoTable td:nth-child(9),
#savedCargoTable th:nth-child(9) {
    border-left: none !important;
}
.product-package,
.product-package * {
    text-align: left !important;
}

.lq-block,
.overpack-block,
.empty-uncleaned-block {
    margin-bottom: 10px;
}
.product-package strong {
    display: inline-block;
    margin-bottom: 4px;
}


/* ============================
   PLANNER CONTAINER INPUT — DARK MODE
============================ */
.planner-container-input {
    width: 100%;
    padding: 8px 10px;
    margin: 6px 0;

    background: #1a1a1a;
    /* Darker than #1e1e1e */
    color: #e6e6e6;

    border: 1px solid #333;
    /* Slightly darker border */
    border-radius: 6px;

    font-size: 14px;
    box-sizing: border-box;
}

/* Focus state — darker + clearer border */
.planner-container-input:focus {
    outline: none;
    border-color: #666;
    /* Subtle highlight */
    background: #161616;
    /* Darker than normal */
}

/* Hover state — slightly darker */
.planner-container-input:hover {
    background: #1c1c1c;
    /* Darker hover */
}

#planner_cont_count {
    width: 50px;
    padding: 6px;

    background: #1a1a1a;
    /* darker base */
    color: #e6e6e6;
    /* light text */

    border: 1px solid #333;
    /* dark border */
    border-radius: 4px;

    font-size: 14px;
    box-sizing: border-box;
}

/* Hover */
#planner_cont_count:hover {
    background: #1c1c1c;
    /* slightly darker */
}

/* Focus */
#planner_cont_count:focus {
    outline: none;
    border-color: #666;
    /* subtle highlight */
    background: #161616;
    /* darkest state */
}
/* ============================
   IMDG Tabs — DARK MODE
============================ */

/* ============================
   Frequent Cargo Tab — DARK MODE
============================ */
.imdg-tab-panel {
    background: #1e1e1e;
    color: #e6e6e6;
}

/* Action button row */
.form-actions {
    margin-bottom: 12px;
}

.form-actions .btn.freq {
    background: #004b6b;
    color: #ffffff;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
}

.form-actions .btn.freq:hover {
    background: #0a2dc8;
    border-color: #777;
}

/* ============================
   Modal Body — DARK MODE
============================ */
.freq-modal-body {
    background: #1e1e1e;
    padding: 14px;
    border: 1px solid #444;
    border-radius: 4px;
    margin-top: 12px;
}

/* Filter input */
#freq-filter {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ffffff;
}

/* ============================
   Scroll Container — DARK MODE
============================ */
.table-scroll-containers {
    max-height: 380px;
    width: 100%;
    overflow-y: auto;
    overflow-x: visible !important;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 6px;
}

/* ============================
   Frequent Cargo Table — DARK MODE
============================ */
#freq-cargo-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e1e1e;
    color: #e6e6e6;
}

#freq-cargo-table th,
#freq-cargo-table td {
    padding: 8px 10px;
    border: 1px solid #444;
    text-align: left;
    white-space: nowrap;
}

/* Header */
#freq-cargo-table th {
    background: #2a2a2a;
    color: #ffffff;
    font-weight: bold;
}

/* Hover */
#freq-cargo-table tbody tr:hover {
    background: #2f3540;
}

/* Selected row */
#freq-cargo-table tr.selected {
    background: #3a4757;
}

/* ============================
   Save Button — DARK MODE
============================ */
#saveUNRecord.btn.save {
    background-color: #004b6b;
    color: #ffffff;
    border: 1px solid #555;
    padding: 8px 14px;
    border-radius: 4px;
    margin-top: 14px;
}

#saveUNRecord.btn.save:hover {
    background: #333;
    border-color: #777;
}

.imdg-tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    background: #1e1e1e;
    /* Dark container */
    padding: 6px;
    border-radius: 6px;
}

/* Tab buttons */
.imdg-tab {
    font-size: 14px;
    padding: 8px 12px;
    background: #2a2a2a;
    /* Dark tab background */
    color: #e6e6e6;
    /* Light text */
    border: 1px solid #444;
    /* Soft border */
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

/* Hover */
.imdg-tab:hover {
    background: #333;
    border-color: #666;
}

/* Active tab */
.imdg-tab.active {
    background: #3a4757;
    /* Muted blue-grey highlight */
    border-color: #6a8bbf;
    /* Subtle accent */
    color: #ffffff;
    font-weight: 600;
}

/* ============================
   IMDG Tabs — DARK MODE
============================ */
.imdg-tabs {
    display: flex;
    margin-bottom: 12px;
    border-bottom: 1px solid #444;
    /* Dark divider */
    background: #1e1e1e;
    /* Dark container */
}

.imdg-tab {
    flex: 1;
    padding: 10px 14px;
    background: #2a2a2a;
    /* Dark tab background */
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(10px, 1.2vw, 16px);
    text-align: center;
    color: #e6e6e6;
    /* Light text */
    transition: background 0.2s ease, border-color 0.2s ease;
}

.imdg-tab:hover {
    background: #333;
}

.imdg-tab.active {
    background: #3a4757;
    /* Blue‑grey active tab */
    border-bottom: 3px solid #6eae14;
    /* Accent green */
    color: #ffffff;
}

/* ============================
   Tab Panels
============================ */
.imdg-tab-panel {
    display: none;
}

.imdg-tab-panel.active {
    display: block;
}

/* ============================
   Modal Body — DARK MODE
============================ */
.newcargo-modal-body {
    background: #2a2f38;
    /* Dark blue‑grey */
    padding: 14px;
    border: 1px solid #444;
    border-radius: 4px;
    margin-top: 12px;
    color: #e6e6e6;
}

/* Inputs */
.newcargo-modal-body select,
#searchCargoName {
    width: 100%;
    font-size: 14px;
    padding: 8px 8px;
    margin-bottom: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1e1e1e;
    color: #ffffff;
}

/* ============================
   Variant Table — DARK MODE
============================ */
#variantTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #1e1e1e;
    color: #e6e6e6;
}

#variantTable th,
#variantTable td {
    padding: 8px 10px;
    border: 1px solid #444;
    text-align: left;
}

#variantTable th {
    background: #2a2a2a;
    font-weight: bold;
    color: #ffffff;
}

/* ============================
   Save Button
============================ */
#saveUNRecords {
    margin-top: 14px;
    display: inline-block;
}

/* ============================
   Error Text
============================ */
.error-text {
    color: #ff6b6b;
    /* Softer red for dark mode */
    font-weight: bold;
    margin: 4px 0 8px 0;
}

/* ============================
   Special Provision Box — DARK MODE
============================ */
.specprov-box {
    background: #1e1e1e;
    /* Dark container */
    border: 1px solid #444;
    /* Soft dark border */
    border-radius: 6px;
    padding: 14px;
    margin-top: 12px;
    color: #e6e6e6;
    /* Light text */
}

/* Heading */
.specprov-box h3 {
    margin: 0 0 10px 0;
    color: #8ab4ff;
    /* Soft blue accent */
    font-size: 18px;
    font-weight: 600;
}

/* Label + checkbox */
.specprov-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 16px;
    color: #e6e6e6;
    line-height: 1.4;
}

/* Checkbox */
.specprov-label input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #6eae14;
    /* Green accent for dark mode */
}

/* Highlighted SP text */
#specProvText {
    color: #ffd966;
    /* Warm yellow highlight */
    font-weight: 600;
}

/* refactor code */

/* Base inline-edit input */
.auto-input {
    width: 95%;
    padding: 3px 5px;

    background: #1a1a1a;
    /* dark base */
    color: #e6e6e6;
    /* light text */

    border: 1px solid #333;
    /* darker border */
    border-radius: 3px;
    text-align: center;

    box-sizing: border-box;
}

/* Tiny-width variants */
.text-tiny,
.units-tiny {
    width: 80px !important;
    max-width: 80px !important;
    background: #353434;
    color: #e6e6e6;
    text-align: left;
}

.text-tinys {
    width: 80px !important;
    max-width: 80px !important;
    background: #353434;
    color: #e6e6e6;
    text-align: left;
    margin-top: 12px;
    margin-bottom: 6px;
}

/* Hover */
.auto-input:hover {
    background: #494949;
    /* slightly darker */
}

/* Focus */
.auto-input:focus {
    outline: none;
    border-color: #666;
    /* subtle highlight */
    background: #161616;
    /* darkest focus shade */
}

/* Save confirmation */
.save-confirm {
    display: none !important;
    opacity: 0;
    transition: opacity 0.4s ease;

    color: #6eae14;
    /* green accent for dark mode */
    font-weight: 600;
    font-size: 14px;
    margin-left: 6px;
    flex-shrink: 0;
}

/* ============================
   Inline edit column container
============================ */
.tech-product-combined {
    background: transparent;
    /* keep table background visible */
    color: #e6e6e6;
    /* light text */
}

/* ============================
   Each block (Tech, Product, FP, BP)
============================ */
.tech-product-combined .tech-name-block,
.tech-product-combined .product-name-block,
.tech-product-combined .fp-declared-block,
.tech-product-combined .boiling-point-block {
    display: flex;
    align-items: left;
    gap: 8px;
    margin-top: 6px;
    color: #e6e6e6;
    text-align: left;
}

/* Remove borders (original behavior) */
.tech-name-block,
.product-name-block,
.fp-declared-block,
.boiling-point-block {
    border-right: none !important;
}

/* ============================
   FORM WRAPPER
============================ */
.multimodal-dec-form {
    background: #ffffff;
    color: #222;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* ============================
   TITLES
============================ */
.form-title {
    color: #1a1a1a;
    margin: 4px 0;
    font-weight: 600;
}

/* ============================
   GRID LAYOUT
============================ */
.form-section {
    margin-bottom: 20px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
}

.span-1 {
    grid-column: span 1;
}

.span-2 {
    grid-column: span 2;
}

/* ============================
   LABELS
============================ */
.field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

/* ============================
   INPUTS & SELECTS
============================ */
.field input[type="text"],
.field select,
.field textarea {
    width: 100%;
    padding: 8px 10px;

    background: #ffffff;
    color: #222;

    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 14px;
    box-sizing: border-box;
}

/* Disabled fields */
.field textarea[disabled],
.field input[disabled] {
    background: #f5f5f5;
    color: #555;
}

/* Multiline input */
.multiline-input {
    height: 60px;
}

/* ============================
   PRINT TEXT BLOCKS
============================ */
.print-text {
    margin-top: 6px;
    padding: 8px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #222;
}

/* ============================
   SELECT DROPDOWN
============================ */
.field select {
    background-color: #ffffff;
    color: #222;
    border: 1px solid #bbb;
}

/* Hover + focus */
.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: #999;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #0077cc;
    box-shadow: 0 0 3px rgba(0, 119, 204, 0.3);
}

/* ============================
   FORM WRAPPER — DARK MODE
============================ */
.multimodal-form {
    background: #121212;
    color: #e6e6e6;
    padding: 20px;
    border-radius: 6px;
}

.haz-consignee-wrap {
    max-width: 100vw;
        margin: 1rem auto;
        padding: 1rem;
        font-family: Arial, sans-serif;
        font-size: 18px;
    
        border-radius: 8px;
        box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
        box-sizing: border-box;
    /* background: #121212; */
    color: #e6e6e6;
    padding: 20px;
    border-radius: 6px;
}
/* ============================
   TITLES
============================ */
.form-title {
    color: #111111;
    /* soft blue accent */
    margin: 4px 0;
    font-weight: 600;
}

/* ============================
   TABLE SCROLL CONTAINER
============================ */
.table-scroll-container {
    max-height: 100vh;
    /* 100% of the screen height */
    overflow-y: auto;
    border: 1px solid #333;
    background: #1a1a1a;
    border-radius: 6px;
    margin-top: 12px;
}

/* ============================
   CONTAINER HEADING ROW
============================ */
.container-heading-row td {
    background: #222 !important;
    color: #e6e6e6 !important;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 12px;
    border-bottom: 1px solid #444;
}

/* Placard container */
.placard-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    align-items: center;
}

/* Small diamond */
.placard {
    width: 0.9rem;
    height: 0.9rem;
    border: 0.18rem solid #ccc;
    /* lighter border for dark mode */
    transform: rotate(45deg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #1a1a1a;
    /* dark fill */
}

/* Symbol inside diamond */
.placard .symbol {
    font-size: 14px;
    transform: rotate(-45deg);
    line-height: 1;
    color: #e6e6e6;
    /* light text */
}

/* Bottom label */
.placard .label {
    font-size: 14px;
    position: absolute;
    bottom: -0.15rem;
    transform: rotate(-45deg);
    white-space: nowrap;
    color: #e6e6e6;
}

/* Placard grid */
.placard-row-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    width: 100%;
    padding: 10px 0;
    justify-items: center;
}

/* Placard images */
.placard-row-block img.hazmat-placard {
    width: 70px;
    height: 70px;
    margin: 5px;
}

.hazmat-placard {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-width: 90px;
}

/* Placard card */
.placard-card {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    /* dark border */
    border-radius: 6px;
    margin-bottom: 16px;
    background: #fcfbfb;
    /* dark card background */
}

/* Card title */
.placard-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #8ab4ff;
    /* blue accent for dark mode */
}

/* Section wrapper */
.placard-section {
    margin-top: 1.25rem;
}

/* Placard box */
.placard-box {
    border: 0.125rem solid #444;
    /* dark border */
    padding: 1rem;
    border-radius: 0.375rem;
    background: #1e1e1e;
    /* dark background */
    margin-top: 1.25rem;
}

/* Placard title */
.placard-title {
    width: 100%;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 0.75rem;
    text-align: left;
    color: #e6e6e6;
    /* light text */
}

/* Note text */
.placard-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 14px;
    color: #cccccc;
    /* softer grey */
}

/* ============================
   BUTTONS — DARK MODE
============================ */
.form-actions .btn {
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.form-actions .btn:hover {
    background: #333;
    border-color: #777;
}

.form-actions .btn.proceed {
    border-color: #6eae14;
    color: #e6e6e6;
}

.form-actions .btn.proceed:hover {
    background: #3a3a3a;
}

.form-actions .btn.export {
    border-color: #8ab4ff;
}

.form-actions .btn.export:hover {
    background: #3a3a3a;
}

@media print {
    .cargo-block {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1.2rem;
        padding: 0.75rem;
        border: 1px solid #000;
    }

    .cargo-header {
        font-weight: bold;
        margin-bottom: 0.4rem;
    }
}

#cargo_summary_container {
    background: #ffffff;
    border: 1px solid #dcdcdc;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;

}

#cargo_summary_container label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

#cargo_summary_container textarea {
    width: 100%;
    min-height: 120px;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.6rem;
    color: #333;
    font-size: 14px;
    resize: vertical;
}

.cargo-block {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    color: #333;
}

.cargo-header {
    font-weight: 700;
    color: #222;
    margin-bottom: 0.4rem;
}

/* Container for each field */
.form-section .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Label styling */
.form-section .field label {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
}

/* Textarea (disabled summary box) */
.summary-style-box {
    width: 100%;
    min-height: 32px;
    resize: none;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.35;
    background: #f8f8f8;
    color: #222;
    cursor: default;
}

/* Display div (visible summary output) */
.summary-display {
    white-space: pre-line;
    padding: 6px 8px;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.35;
    min-height: 20px;
    color: #222;
}

/* Grid layout for 5 fields */
.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

/* Dark mode support */
.dark-mode .summary-style-box {
    background: #1e1e1e;
    border-color: #444;
    color: #e6e6e6;
}

.dark-mode .summary-display {
    color: #e6e6e6;
}

/* Print-safe: prevent splitting fields */
@media print {

    .form-section,
    .field {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

.top-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 18px;
    gap: 12px;
}

.top-action-row .btn {
    font-size: 14px;
    padding: 8px 12px;
    white-space: nowrap;
}
/* ============================================================
   HAZSHIELD DARK MODE — CONSIGNEE MASTER PAGE
   Applies when body has class "dark-mode"
   ============================================================ */

body.dark-mode {
    background: #121212;
    color: #e6e6e6;
}

/* -----------------------------------------
   PAGE WRAPPER
----------------------------------------- */
body.dark-mode .wrap h1 {
    color: #8ab4ff;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

/* -----------------------------------------
   TABLE STYLING
----------------------------------------- */
body.dark-mode table.wp-list-table {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e6e6e6;
}

body.dark-mode table.wp-list-table th {
    background: #222;
    color: #8ab4ff;
    border-bottom: 1px solid #333;
}

body.dark-mode table.wp-list-table td {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    color: #e6e6e6;
}

body.dark-mode table.wp-list-table tr:nth-child(even) td {
    background: #181818;
}

/* Hover row */
body.dark-mode table.wp-list-table tr:hover td {
    background: #262626;
}

/* -----------------------------------------
   BUTTONS
----------------------------------------- */
body.dark-mode .button {
    background: #333;
    color: #e6e6e6;
    border: 1px solid #444;
}

body.dark-mode .button:hover {
    background: #444;
    border-color: #555;
}

body.dark-mode .button-primary {
    background: #0059c9;
    border-color: #006be6;
    color: #fff;
}

body.dark-mode .button-primary:hover {
    background: #0073ff;
}

body.dark-mode .button-danger {
    background: #7a0000;
    border-color: #990000;
    color: #fff;
}

body.dark-mode .button-danger:hover {
    background: #b30000;
}

/* -----------------------------------------
   MODAL BACKDROP
----------------------------------------- */
body.dark-mode #consigneeModal {
    background: rgba(0, 0, 0, 0.75);
}

/* -----------------------------------------
   MODAL CONTENT
----------------------------------------- */
body.dark-mode #consigneeModal .modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 6px;
    width: 420px;
    margin: 80px auto;
    color: #e6e6e6;
}

body.dark-mode #consigneeModal h2,
body.dark-mode #consigneeModal h3 {
    color: #8ab4ff;
}

/* -----------------------------------------
   FORM FIELDS
----------------------------------------- */
body.dark-mode input[type="text"],
body.dark-mode textarea,
body.dark-mode select {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e6e6e6;
    padding: 8px 10px;
    border-radius: 4px;
}

body.dark-mode input[type="text"]:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 1px #8ab4ff;
    outline: none;
}

/* -----------------------------------------
   SELECT OPTIONS
----------------------------------------- */
body.dark-mode select option {
    background: #1a1a1a;
    color: #e6e6e6;
}

body.dark-mode select option:hover {
    background: #2a2a2a;
}

/* Special highlight for Add New */
body.dark-mode select option[value="add_new"] {
    color: #8ab4ff;
    font-weight: 600;
    background: #0f1a2b;
}

/* -----------------------------------------
   TABLE EMPTY STATE
----------------------------------------- */
body.dark-mode .no-items {
    color: #aaa;
}

/* -----------------------------------------
   SCROLLBARS
----------------------------------------- */
body.dark-mode ::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Base table */
.table-h12-style {
    border-collapse: collapse;
    table-layout: auto;
    width: auto !important;
    background: #1e1e1e;
    /* Dark base */
    color: #e6e6e6;
}

.table-h12-style th,
.table-h12-style td {
    font-size: 14px;
    padding: 4px 6px;
    border-bottom: 1px solid #444;
    /* Dark divider */
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    background: #1e1e1e;
}

/* Narrow columns */
.table-h12-style :is(th, td):nth-child(1),
.table-h12-style :is(th, td):nth-child(2),
.table-h12-style :is(th, td):nth-child(3),
.table-h12-style :is(th, td):nth-child(4),
.table-h12-style :is(th, td):nth-child(5) {
    width: 15%;
}

.table-h12-style :is(th, td):nth-child(6){
    width: 25%;
    text-align: left;
}

/* Sortable header */
.table-h12-style th.sortable {
    cursor: pointer;
    background: #2a2a2a;
    color: #ffffff;
    user-select: none;
}

.table-h12-style th.sortable:hover {
    background: #3a3a3a;
    /* Slightly lighter */
}

/* ⭐ Row hover — lighter shade */
.table-h12-style tbody tr:hover td {
    background: #2f3540 !important;
    /* Lightened dark shade */
    border-color: #4a6a8a;
    /* Soft blue-grey highlight */
}

/* Selected row */
.table-h12-style tr.selected td {
    background: #3a4757 !important;
    /* Distinct from hover */
}