:root {
    --nci-navy: #141D4B;
    --nci-orange: #FF9D3D;
    --nci-orange-hover: #e88a2d;
    --nci-white: #FFFFFF;
    --nci-dark: #212529;
    --nci-gray: #6c757d;
    --nci-light-gray: #f8f9fa;
    --nci-border: #dee2e6;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--nci-dark);
    font-size: 0.875rem;
}

/* Consistent form elements */
.form-control, .form-select, .bootstrap-select .btn {
    font-size: 0.85rem;
    border-radius: 6px;
    border-color: var(--nci-border);
}
.form-control:focus, .form-select:focus {
    border-color: var(--nci-orange);
    box-shadow: 0 0 0 0.15rem rgba(255, 157, 61, 0.2);
}
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nci-dark);
    margin-bottom: 0.25rem;
}
/* Pagination bar — compact, right-aligned, with summary + page-size selector
   so the bar never stretches full-width or dominates the bottom of the grid. */
.nci-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 6px 0;
}
.nci-pager .nci-pager-summary {
    font-size: 0.78rem;
    color: var(--nci-gray);
    white-space: nowrap;
}
.nci-pager .nci-pager-summary strong { color: var(--nci-dark); }
.nci-pager .nci-pager-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--nci-gray);
}
.nci-pager .nci-pager-size select {
    width: auto;
    min-width: 60px;
    padding: 2px 24px 2px 8px;
    font-size: 0.78rem;
    height: 28px;
}
/* The Bootstrap .pagination inside the pager stays compact. */
.nci-pager .pagination {
    margin: 0;
}
.nci-pager .pagination .page-link {
    font-size: 0.78rem;
    padding: 2px 8px;
    min-width: 28px;
    text-align: center;
}

/* Filter bar field: label stacked above input/select/datepicker.
   Usage: <div class="filter-field"><label>Caption</label>{control}</div> */
.filter-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.filter-field > label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.filter-field > .bootstrap-select {
    width: 100% !important;
}

/* bootstrap-select: inside .col-* form columns, force block so label stacks above.
   Outside a .col-* (e.g. filter bars with explicit widths), leave default inline-block. */
[class*="col-"] > .bootstrap-select,
[class*="col-"] .bootstrap-select {
    display: block !important;
    width: 100% !important;
}
.bootstrap-select > .btn {
    padding: 0.3rem 0.65rem;
    background-color: #fff;
    border: 1px solid var(--nci-border);
    box-shadow: none;
    text-align: left;
}
.bootstrap-select > .btn:focus,
.bootstrap-select > .btn:focus-visible {
    border-color: var(--nci-orange);
    box-shadow: 0 0 0 0.15rem rgba(255, 157, 61, 0.2);
    outline: 0;
}
/* Match form-select-sm height when wrapped select was sm */
.bootstrap-select.form-select-sm > .btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    min-height: calc(1.5em + 0.5rem + 2px);
}

/* Navbar */
.nci-navbar {
    background-color: var(--nci-white);
    border-bottom: 3px solid var(--nci-orange);
    padding: 0.5rem 2rem;
}
.nci-navbar .nav-link {
    color: var(--nci-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
}
.nci-navbar .nav-link:hover {
    color: var(--nci-orange);
}
.nci-logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--nci-navy);
}
.nci-logo-icon {
    color: var(--nci-orange);
    font-size: 2rem;
}

/* Global button rounding */
.btn {
    border-radius: 25px;
}
.btn-sm {
    border-radius: 20px;
}
.btn-lg {
    border-radius: 30px;
}

/* Orange buttons */
.btn-nci {
    background-color: var(--nci-orange);
    border-color: var(--nci-orange);
    color: var(--nci-white);
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}
.btn-nci:hover {
    background-color: var(--nci-orange-hover);
    border-color: var(--nci-orange-hover);
    color: var(--nci-white);
}
.btn-nci-outline {
    border: 2px solid var(--nci-orange);
    color: var(--nci-orange);
    background: transparent;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}
.btn-nci-outline:hover {
    background-color: var(--nci-orange);
    color: var(--nci-white);
}

/* Hero section */
.nci-hero {
    background-color: var(--nci-navy);
    color: var(--nci-white);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.nci-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--nci-orange);
    line-height: 1.2;
}
.nci-hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
}

/* Section headings */
.section-label {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--nci-gray);
    font-weight: 600;
}
.section-heading {
    color: var(--nci-orange);
    font-size: 2rem;
    font-weight: 700;
}

/* Footer */
.nci-footer {
    border-top: 1px solid var(--nci-border);
    padding: 3rem 0 1rem;
}
.nci-footer .footer-heading {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--nci-orange);
    font-weight: 700;
    margin-bottom: 1rem;
}
.nci-footer a {
    color: var(--nci-dark);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}
.nci-footer a:hover {
    color: var(--nci-orange);
}

/* Newsletter */
.nci-newsletter {
    padding: 2.5rem 0;
    border-bottom: 3px solid var(--nci-orange);
}

/* Tracking input */
.nci-track-input {
    border: 1px solid var(--nci-border);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

/* Location dropdown */
.nci-location-dropdown {
    cursor: pointer;
    font-weight: 500;
    color: var(--nci-dark);
}
.nci-location-dropdown .location-icon {
    color: var(--nci-orange);
}

/* Portal sidebar styles */
.nci-sidebar {
    background-color: var(--nci-navy);
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
}
.nci-sidebar::-webkit-scrollbar { width: 5px; }
.nci-sidebar::-webkit-scrollbar-track { background: transparent; }
.nci-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.nci-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.nci-sidebar .sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nci-sidebar .sidebar-header h5 {
    color: var(--nci-white);
    margin: 0;
    font-weight: 700;
}
.nci-sidebar .sidebar-header small {
    color: rgba(255,255,255,0.5);
}
.nci-sidebar .nav-section {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.3rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 0.25rem;
}
.nci-sidebar .nav-section:first-child { border-top: none; margin-top: 0; }
.nci-sidebar .nav-section:hover { color: rgba(255,255,255,0.7); }
.nci-sidebar .nav-section .toggle-icon {
    transition: transform 0.2s;
    font-size: 0.6rem;
}
.nci-sidebar .nav-section[aria-expanded="false"] .toggle-icon,
.nci-sidebar .nav-section.collapsed .toggle-icon { transform: rotate(-90deg); }
.nci-sidebar .sidebar-nav { padding: 0; }
.nci-sidebar .sidebar-nav > a.nav-link { padding: 0.6rem 1.25rem; }
.nci-sidebar .sidebar-nav .collapse a.nav-link,
.nci-sidebar .sidebar-nav .collapsing a.nav-link {
    padding: 0.4rem 1.25rem 0.4rem 2.25rem;
    font-size: 0.85rem;
}
.nci-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nci-sidebar .nav-link:hover,
.nci-sidebar .nav-link.active {
    color: var(--nci-white);
    background-color: rgba(255,255,255,0.05);
    border-left-color: var(--nci-orange);
}
.nci-sidebar .nav-link i {
    width: 24px;
    margin-right: 0.5rem;
    text-align: center;
}
.nci-sidebar-content {
    margin-left: 260px;
    padding: 0;
    min-height: 100vh;
    background: #f4f6f9;
}
.nci-portal-topbar {
    background: var(--nci-white);
    border-bottom: 1px solid var(--nci-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.nci-portal-content {
    padding: 1.5rem;
}

/* Cards */
.nci-card {
    border: 1px solid var(--nci-border);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}
.nci-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nci-stat-card {
    border: 1px solid var(--nci-border);
    border-radius: 8px;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

/* Mega Dropdown */
.mega-dropdown {
    border: 1px solid var(--nci-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.mega-dropdown .dropdown-item {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 4px;
}
.mega-dropdown .dropdown-item:hover {
    background-color: rgba(255,157,61,0.08);
    color: var(--nci-orange);
}

/* Responsive */
/* ── Dual-Language Field Labels ──────────────────────────── */
.nci-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
}
.nci-field-label .field-primary {
    display: inline;
    color: var(--nci-dark);
}
.nci-field-label .field-english {
    display: inline;
    color: var(--nci-gray);
    font-weight: 400;
    font-size: 0.75rem;
    margin-left: 0.35rem;
}
.nci-field-label .field-english::before {
    content: "(";
}
.nci-field-label .field-english::after {
    content: ")";
}

/* ── Data Grid / Table Styles ──────────────────────────── */
.nci-table {
    font-size: 0.875rem;
}
.nci-table thead th {
    background-color: var(--nci-navy);
    color: var(--nci-white);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.65rem 0.75rem;
    border: none;
    white-space: nowrap;
}
.nci-table thead th .th-english {
    display: block;
    font-weight: 400;
    font-size: 0.65rem;
    opacity: 0.7;
    text-transform: none;
    letter-spacing: 0;
}
.nci-table tbody td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
    border-color: var(--nci-border);
}
.nci-table tbody tr:hover {
    background-color: rgba(255, 157, 61, 0.05);
}
.nci-table .btn-action {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Status badges */
.badge-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 3px;
    display: inline-block;
    white-space: nowrap;
    background-color: #6c757d;  /* default fallback so unknown statuses are never invisible */
    color: #fff;
    text-transform: capitalize;
}
/* Green: completed / positive */
.badge-active, .badge-delivered, .badge-completed, .badge-released, .badge-paid,
.badge-paid-delivered, .badge-paid-picked-up, .badge-available-for-collection,
.badge-ready-for-billing, .badge-closed { background-color: #198754; color: #fff; }

/* Orange: pending / waiting / action needed */
.badge-pending, .badge-scheduled, .badge-new, .badge-created, .badge-waiting,
.badge-open, .badge-ready-to-ship, .badge-packed { background-color: var(--nci-orange); color: #fff; }

/* Cyan: processing / stored */
.badge-processing, .badge-received, .badge-stored,
.badge-processing-for-shipping, .badge-processing-at-customs,
.badge-processing-invoice-required, .badge-received-at-dest-warehouse { background-color: #0dcaf0; color: #212529; }

/* Blue: in transit / shipped */
.badge-in-transit, .badge-intransit, .badge-shipped, .badge-loaded,
.badge-in-transit-arrival-processing, .badge-paid-online,
.badge-cargo-release { background-color: #0d6efd; color: #fff; }

/* Red: problem / cancelled */
.badge-cancelled, .badge-deleted, .badge-abandoned-at-customs,
.badge-no-aoa, .badge-no-aoa-no-agent-authorization,
.badge-not-received, .badge-not-received-short-shipped,
.badge-short-shipped, .badge-delivered-short-shipped,
.badge-hold-at-dest-warehouse, .badge-on-hand-hold,
.badge-processing-held-for-inspection, .badge-suspended { background-color: #dc3545; color: #fff; }

/* Purple: warehouse hold / on-hand */
.badge-onhand, .badge-on-hand { background-color: #6f42c1; color: #fff; }

/* Gray: drafts / misc */
.badge-draft, .badge-submitted, .badge-customs-refund,
.badge-resubmitted, .badge-aum { background-color: var(--nci-gray); color: #fff; }

/* Filter bar */
.nci-filter-bar {
    background-color: var(--nci-light-gray);
    border: 1px solid var(--nci-border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.nci-filter-bar .form-control,
.nci-filter-bar .form-select {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}
.nci-filter-bar label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nci-gray);
    margin-bottom: 0.2rem;
}

/* Page header */
.nci-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--nci-orange);
}
.nci-page-header h4 {
    margin: 0;
    color: var(--nci-navy);
    font-weight: 700;
}
.nci-page-header .page-english {
    color: var(--nci-gray);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Print styles */
@media print {
    .nci-sidebar, .nci-portal-topbar, .nci-filter-bar,
    .btn, .no-print { display: none !important; }
    .nci-sidebar-content { margin-left: 0 !important; }
    .field-english { display: none !important; }
}

/* Responsive */
@media (max-width: 991px) {
    .nci-sidebar { margin-left: -260px; }
    .nci-sidebar.show { margin-left: 0; }
    .nci-sidebar-content { margin-left: 0; }
    .nci-hero h1 { font-size: 2rem; }
}

/* Row action dots - no border, no arrow */
.nci-table .btn-link.text-dark {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}
.nci-table .dropdown-toggle::after {
    display: none !important;
}

/* Fix dropdown clipping inside tables - use fixed positioning */
.table-responsive {
    overflow: visible;
}
td .dropdown .dropdown-menu {
    position: fixed !important;
    z-index: 1050;
}

/* Consistent action dropdown - all tables */
td .dropdown .btn-action-dots {
    background: none;
    border: none;
    box-shadow: none;
    padding: 2px 6px;
    color: var(--nci-dark);
    font-size: 1rem;
}
td .dropdown .btn-action-dots:hover {
    color: var(--nci-orange);
}
td .dropdown .btn-action-dots::after {
    display: none;
}

/* Localized label hover - show English tooltip */
[data-en] {
    cursor: help;
    border-bottom: 1px dotted rgba(0,0,0,0.2);
}
