/* ==========================================================================
   Dashboard design layer
   Every rule is scoped to .nx-dash so no other admin page is affected.
   ========================================================================== */

.nx-dash {
    --nx-radius: 16px;
    --nx-radius-sm: 10px;
    --nx-gap: 1rem;
    --nx-pad: 1.15rem;
    --nx-border: #E8EAEE;
    --nx-bg-soft: #F7F8FA;
    --nx-text: #111827;
    --nx-muted: #6B7280;
    --nx-faint: #9CA3AF;
    --nx-green: #10B981;
    --nx-green-soft: #ECFDF5;
    --nx-grey: #C7CCD4;
    --nx-amber: #F59E0B;
    --nx-amber-soft: #FFFBEB;
    --nx-red: #EF4444;
    --nx-red-soft: #FEF2F2;
    --nx-blue: #3B82F6;
    --nx-blue-soft: #EFF6FF;
    --nx-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);

    padding: 1.25rem 1.5rem 2rem;
    max-width: 1720px;
}

@media (max-width: 767.98px) {
    .nx-dash { padding: 1rem .9rem 1.5rem; }
}

/* ---------- Grid: one gap for everything ---------- */
.nx-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--nx-gap);
    align-items: stretch;
}

/* Livewire wraps some components in an extra element, so every level between
   the grid cell and the card has to carry the stretched height. */
.nx-grid > [class*="nx-span"] > * { height: 100%; }
.nx-grid > [class*="nx-span"] .card.nx-card { height: 100%; }

.nx-grid > [class*="nx-span"] .card.nx-card {
    display: flex;
    flex-direction: column;
}

.nx-grid > [class*="nx-span"] .card.nx-card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
}

.nx-grid > .nx-span-12 { grid-column: span 12; }
.nx-grid > .nx-span-6  { grid-column: span 6; }

@media (max-width: 1299.98px) {
    .nx-grid > .nx-span-6 { grid-column: span 12; }
}

/* ---------- Page header ---------- */
.nx-dash .nx-page-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--nx-gap);
    margin-bottom: var(--nx-gap);
}

.nx-dash .nx-page-heading { min-width: 0; }

.nx-dash .nx-page-title {
    font-size: 1.5rem;
    font-weight: 680;
    letter-spacing: -.02em;
    color: var(--nx-text);
    margin: 0;
    line-height: 1.2;
}

.nx-dash .nx-page-sub {
    font-size: .85rem;
    color: var(--nx-faint);
    margin: .15rem 0 0;
}

.nx-dash .nx-page-action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--nx-text);
    color: #fff;
    border-radius: 10px;
    padding: .5rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .12s ease, transform .12s ease;
}

.nx-dash .nx-page-action:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Charts sitting side by side must line up. */
.nx-dash .row > [class*="col-"] > .nx-chart-card { height: 100%; }

/* One scroll height for every list card, overriding the per-card inline styles.
   Pending is excluded: it shares a row and has to stretch to its neighbour. */
.nx-dash .card.nx-card.active-shipments-card,
.nx-dash .card.nx-card.supplier-card {
    height: auto;
    display: flex;
    flex-direction: column;
}

.nx-dash .card.nx-card.active-shipments-card > .card-body,
.nx-dash .card.nx-card.supplier-card > .card-body,
.nx-dash .card.nx-card.pending-shipments-card > .card-body {
    padding: 0;
    max-height: 380px;
    overflow: auto;
}

/* ---------- Shipment link + no sideways scrolling ---------- */
.nx-dash .nx-ship-link {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: .855rem;
    color: var(--nx-text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.nx-dash .nx-ship-link:hover {
    color: var(--nx-blue);
    border-bottom-color: currentColor;
    text-decoration: none;
}

.nx-dash .nx-no-hscroll { overflow-x: hidden; }
.nx-dash .nx-no-hscroll .table { table-layout: fixed; width: 100%; }
.nx-dash .nx-no-hscroll .table td,
.nx-dash .nx-no-hscroll .table th { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Waiting time ---------- */.nx-dash .nx-wait {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: .84rem;
    color: var(--nx-muted);
}

.nx-dash .nx-wait.is-stale { color: #B45309; }
.nx-dash .nx-wait i { font-size: .9rem; opacity: .7; }

.nx-dash .nx-wait-note {
    display: block;
    font-size: .7rem;
    color: var(--nx-faint);
    margin-top: .1rem;
}

/* ---------- Stat tiles ---------- */
.nx-dash .nx-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--nx-gap);
}

.nx-dash .nx-stat {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow);
    padding: .95rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .14s ease, transform .14s ease, border-color .14s ease;
}

a.nx-dash .nx-stat:hover,
.nx-dash a.nx-stat:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
    border-color: #D9DDE3;
    box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .08);
}

.nx-dash .nx-stat-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nx-dash .nx-stat-icon.is-green { background: var(--nx-green-soft); color: var(--nx-green); }
.nx-dash .nx-stat-icon.is-blue  { background: var(--nx-blue-soft);  color: var(--nx-blue); }
.nx-dash .nx-stat-icon.is-amber { background: var(--nx-amber-soft); color: var(--nx-amber); }
.nx-dash .nx-stat-icon.is-slate { background: var(--nx-bg-soft);    color: var(--nx-muted); }

.nx-dash .nx-stat-body { display: flex; flex-direction: column; min-width: 0; }

.nx-dash .nx-stat-value {
    font-size: 1.45rem;
    font-weight: 680;
    line-height: 1.15;
    color: var(--nx-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.nx-dash .nx-stat-label {
    font-size: .76rem;
    color: var(--nx-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1199.98px) {
    .nx-dash .nx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .nx-dash .nx-stats { grid-template-columns: 1fr; }
}

/* ---------- Card shell ---------- */
.nx-dash .card.nx-card {
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow);
    background: #fff;
    overflow: hidden;
}

.nx-dash .card.nx-card > .card-header {
    background: #fff;
    border-bottom: 1px solid var(--nx-border);
    padding: var(--nx-pad);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}

.nx-dash .card.nx-card > .card-body {
    padding: 0;
}

/* Header title block: replaces the old uppercase muted label */
.nx-dash .nx-head-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--nx-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--nx-blue-soft);
    color: var(--nx-blue);
}

.nx-dash .nx-head-icon.is-green { background: var(--nx-green-soft); color: var(--nx-green); }
.nx-dash .nx-head-icon.is-amber { background: var(--nx-amber-soft); color: var(--nx-amber); }

.nx-dash .nx-head-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
}

.nx-dash .nx-head-title {
    font-size: .95rem;
    font-weight: 650;
    color: var(--nx-text);
    letter-spacing: -.01em;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.nx-dash .nx-head-sub {
    font-size: .78rem;
    color: var(--nx-faint);
    margin: 0;
}

.nx-dash .nx-head-spacer { display: none; }

.nx-dash .card.nx-card > .card-header .nx-segment { margin-left: auto; flex: 0 0 auto; }

@media (max-width: 575.98px) {
    .nx-dash .card.nx-card > .card-header .nx-segment {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
}

/* ---------- Tables ---------- */
.nx-dash .nx-card .table {
    margin: 0;
    color: var(--nx-text);
    font-size: .855rem;
}

.nx-dash .nx-card .table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--nx-bg-soft);
    border: 0;
    border-bottom: 1px solid var(--nx-border);
    padding: .6rem .9rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nx-faint);
    white-space: nowrap;
}

.nx-dash .nx-card .table > tbody > tr > td {
    border: 0;
    border-bottom: 1px solid #F1F2F4;
    padding: .7rem .9rem;
    vertical-align: middle;
}

.nx-dash .nx-card .table > tbody > tr:last-child > td { border-bottom: 0; }

/* Keeps the existing per-shipment pastel colour, but as a clean left accent
   instead of a gradient wash with a hard black border. */
.nx-dash .active-shipments-card .table > tbody > tr {
    transition: background-color .12s ease;
}

.nx-dash .active-shipments-card td.as-shipcell {
    background: transparent;
    border-left: 0;
    box-shadow: inset 3px 0 0 0 var(--ship-bg, transparent);
}

.nx-dash .nx-card .table > tbody > tr:hover > td { background: var(--nx-bg-soft); }

.nx-dash .nx-card .table > tbody > tr.table-warning > td {
    background: var(--nx-amber-soft);
}

/* ---------- Scroll area ---------- */
.nx-dash .nx-card > .card-body { overscroll-behavior: contain; }

.nx-dash .nx-card > .card-body::-webkit-scrollbar { width: 10px; }
.nx-dash .nx-card > .card-body::-webkit-scrollbar-thumb {
    background: #DFE2E7;
    border-radius: 999px;
    border: 3px solid #fff;
}
.nx-dash .nx-card > .card-body::-webkit-scrollbar-track { background: transparent; }

/* ---------- Segmented tabs (replaces bootstrap nav-tabs look) ---------- */
.nx-dash .nx-card .nav-tabs {
    border: 0;
    gap: .25rem;
    padding: .75rem 1.15rem 0;
    flex-wrap: wrap;
}

.nx-dash .nx-card .nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .34rem .8rem;
    font-size: .82rem;
    font-weight: 550;
    color: var(--nx-muted);
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: background-color .12s ease, color .12s ease;
}

.nx-dash .nx-card .nav-tabs .nav-link:hover {
    background: var(--nx-bg-soft);
    color: var(--nx-text);
}

.nx-dash .nx-card .nav-tabs .nav-link.active {
    background: var(--nx-text);
    border-color: var(--nx-text);
    color: #fff;
}

.nx-dash .nx-card .nav-tabs .nav-link .badge {
    font-size: .68rem;
    font-weight: 650;
    padding: .18em .45em;
    border-radius: 999px;
}

.nx-dash .nx-card .nav-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
}

/* ---------- Badges ---------- */
.nx-dash .nx-card .badge {
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: 999px;
    padding: .28em .6em;
}

.nx-dash .nx-card .badge.bg-danger,
.nx-dash .nx-card .badge.badge-danger { background: var(--nx-red-soft) !important; color: #B91C1C !important; }

.nx-dash .nx-card .badge.bg-warning,
.nx-dash .nx-card .badge.badge-warning { background: var(--nx-amber-soft) !important; color: #B45309 !important; }

.nx-dash .nx-card .badge.bg-success,
.nx-dash .nx-card .badge.badge-success { background: var(--nx-green-soft) !important; color: #047857 !important; }

.nx-dash .nx-card .badge.bg-secondary,
.nx-dash .nx-card .badge.badge-secondary { background: var(--nx-bg-soft) !important; color: var(--nx-muted) !important; }

/* ---------- Buttons ---------- */
.nx-dash .nx-card .btn {
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 550;
    padding: .3rem .65rem;
}

.nx-dash .nx-card .btn-sm { padding: .26rem .55rem; font-size: .78rem; }

.nx-dash .nx-card .btn-secondary,
.nx-dash .nx-card .btn-outline-secondary {
    background: #fff;
    border-color: var(--nx-border);
    color: var(--nx-muted);
}

.nx-dash .nx-card .btn-secondary:hover,
.nx-dash .nx-card .btn-outline-secondary:hover {
    background: var(--nx-bg-soft);
    border-color: #D6DAE0;
    color: var(--nx-text);
}

.nx-dash .nx-card .btn-group { gap: .25rem; }

.nx-dash .nx-card .btn-group > .btn {
    box-shadow: none;
    border-radius: 8px !important;
}

/* Row actions: equal-weight icon buttons instead of a filled button block.
   The assign button keeps its meaning through colour (grey = unassigned,
   green = you, blue = someone else). */
.nx-dash .nx-row-actions .btn-group > .btn {
    min-width: 32px;
    height: 30px;
    padding: 0 .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 1px solid var(--nx-border);
    background: #fff;
    color: var(--nx-muted);
    font-size: .8rem;
    line-height: 1;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.nx-dash .nx-row-actions .btn-group > .btn i { font-size: .95rem; }

.nx-dash .nx-row-actions .btn-group > .btn:hover {
    background: var(--nx-bg-soft);
    border-color: #D6DAE0;
    color: var(--nx-text);
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-primary {
    background: var(--nx-blue-soft);
    border-color: #DBEAFE;
    color: #1D4ED8;
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-primary:hover {
    background: #DBEAFE;
    border-color: #BFDBFE;
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-success {
    background: var(--nx-green-soft);
    border-color: #D1FAE5;
    color: #047857;
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-success:hover {
    background: #D1FAE5;
    border-color: #A7F3D0;
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-info {
    background: #EEF2FF;
    border-color: #E0E7FF;
    color: #4338CA;
}

.nx-dash .nx-row-actions .btn-group > .btn.btn-info:hover {
    background: #E0E7FF;
    border-color: #C7D2FE;
}

.nx-dash .nx-card .badge.badge-dark,
.nx-dash .nx-card .badge.bg-dark {
    background: var(--nx-text) !important;
    color: #fff !important;
}

/* ---------- Copy affordance ---------- */
.nx-dash .nx-card .copy-btn {
    color: var(--nx-faint);
    opacity: 0;
    transition: opacity .12s ease, color .12s ease;
}

.nx-dash .nx-card tr:hover .copy-btn { opacity: 1; }
.nx-dash .nx-card .copy-btn:hover { color: var(--nx-blue); }

.nx-dash .nx-card .ref {
    font-variant-numeric: tabular-nums;
    font-size: .855rem;
}

/* ---------- Empty state ---------- */
.nx-dash .nx-empty {
    padding: 2.25rem 1.15rem;
    text-align: center;
    color: var(--nx-faint);
}

.nx-dash .nx-empty i { font-size: 1.6rem; display: block; margin-bottom: .5rem; opacity: .5; }
.nx-dash .nx-empty p { margin: 0; font-size: .85rem; }

/* ==========================================================================
   Requests & Confirms card
   ========================================================================== */

.nx-dash .card.nx-card.nx-chart-card > .card-body { padding: 1.15rem; }

.nx-dash .nx-segment {
    display: inline-flex;
    background: var(--nx-bg-soft);
    border: 1px solid var(--nx-border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.nx-dash .nx-segment button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .28rem .8rem;
    font-size: .8rem;
    font-weight: 550;
    color: var(--nx-muted);
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.nx-dash .nx-segment button:hover { color: var(--nx-text); }

.nx-dash .nx-segment button.is-active {
    background: #fff;
    color: var(--nx-text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.nx-dash .nx-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin-bottom: 1.1rem;
}

.nx-dash .nx-kpi-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--nx-faint);
    margin-bottom: .15rem;
}

.nx-dash .nx-kpi-value {
    font-size: 1.65rem;
    font-weight: 680;
    line-height: 1.1;
    color: var(--nx-text);
    font-variant-numeric: tabular-nums;
}

.nx-dash .nx-kpi-value.is-green { color: var(--nx-green); }

.nx-dash .nx-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
}

.nx-dash .nx-dot.is-grey { background: var(--nx-grey); }
.nx-dash .nx-dot.is-green { background: var(--nx-green); }

.nx-dash .nx-chart-wrap { position: relative; height: 240px; }
.nx-dash .nx-chart-wrap.is-tall { height: 290px; }

@media (max-width: 575.98px) {
    .nx-dash .nx-kpis { gap: 1.1rem; }
    .nx-dash .nx-kpi-value { font-size: 1.35rem; }
    .nx-dash .nx-chart-wrap { height: 200px; }
}

/* ==========================================================================
   Embedded cards outside the dashboard page (e.g. the quote form)
   ========================================================================== */

.nx-dash.nx-dash-embed { padding: 0; max-width: none; }

/* The embed reset would strip the modal's own padding. */
.modal-body.nx-dash.nx-dash-embed { padding: 1rem 1.15rem; }

.nx-dash .nx-card > .card-footer {
    background: var(--nx-bg-soft);
    border-top: 1px solid var(--nx-border);
    padding: .75rem var(--nx-pad);
    font-size: .82rem;
    color: var(--nx-muted);
}

.nx-dash .nx-card .table td.nx-num,
.nx-dash .nx-card .table th.nx-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-dash .nx-card .table td.nx-num-c,
.nx-dash .nx-card .table th.nx-num-c { text-align: center; }

.nx-dash .nx-sub { font-size: .74rem; color: var(--nx-faint); display: block; }
.nx-dash .nx-inline-sub { font-size: .74rem; color: var(--nx-faint); margin-left: .35rem; }

.nx-dash .nx-head-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    flex: 0 0 auto;
}

.nx-dash .nx-check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .8rem;
    font-weight: 550;
    color: var(--nx-muted);
    cursor: pointer;
    white-space: nowrap;
}

.nx-dash .nx-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--nx-text);
    cursor: pointer;
}

.nx-dash .nx-check:hover { color: var(--nx-text); }

@media (max-width: 767.98px) {
    .nx-dash .nx-head-actions { margin-left: 0; width: 100%; justify-content: space-between; }
}
.nx-dash .nx-pct { font-weight: 650; font-variant-numeric: tabular-nums; }
.nx-dash .nx-pct.is-green { color: #047857; }
.nx-dash .nx-pct.is-red { color: #B91C1C; }
.nx-dash .nx-strong { font-weight: 650; font-variant-numeric: tabular-nums; }

.nx-dash .nx-suggestion {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
}

.nx-dash .nx-suggestion-value {
    font-size: 1.05rem;
    font-weight: 680;
    color: var(--nx-text);
    font-variant-numeric: tabular-nums;
}

.nx-dash-embed .nx-card .table td,
.nx-dash-embed .nx-card .table th { white-space: nowrap; }

.nx-dash-embed .nx-card > .card-body { overflow-x: auto; }

/* Confirmed references carry the weight here, so they get a green accent. */
.nx-dash-embed .nx-card .table > tbody > tr.nx-confirmed > td { background: var(--nx-green-soft); }
.nx-dash-embed .nx-card .table > tbody > tr.nx-confirmed > td:first-child { box-shadow: inset 3px 0 0 0 var(--nx-green); }
.nx-dash-embed .nx-card .table > tbody > tr.nx-confirmed:hover > td { background: #DCFCE7; }
.nx-dash-embed .nx-card .table > tbody > tr:not(.nx-confirmed) > td { color: var(--nx-muted); }

.nx-dash-embed .nx-confirmed-icon { color: var(--nx-green); font-size: .95rem; margin-right: .2rem; vertical-align: -1px; }

/* Denser rows than on the dashboard: this table is a reference, not the page. */
.nx-dash-embed .nx-card .table > thead > tr > th { padding: .45rem .8rem; }
.nx-dash-embed .nx-card .table > tbody > tr > td { padding: .38rem .8rem; }

/* ---------- Live margin next to the offered price ---------- */
.nx-margin-bar,
.nx-price-box {
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    background: #fff;
    box-shadow: var(--nx-shadow);
    padding: .6rem .9rem;
    min-height: 82px;
}

.nx-margin-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem 1rem;
}

.nx-price-box { display: flex; flex-direction: column; justify-content: center; }

.nx-price-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nx-faint);
    margin-bottom: .3rem;
}

.nx-price-box input[type="number"] {
    border-radius: var(--nx-radius-sm);
    font-size: 1.15rem;
    font-weight: 620;
    font-variant-numeric: tabular-nums;
    color: var(--nx-text);
    height: 40px;
}

.nx-price-box .input-group { flex-wrap: nowrap; }

.nx-price-box .input-group-text {
    background: var(--nx-bg-soft);
    border-color: var(--nx-border);
    color: var(--nx-muted);
    font-weight: 600;
    height: 40px;
}

/* Prefix and input form one pill: only the outer corners are rounded. */
.nx-price-box .input-group-prepend .input-group-text {
    border-radius: var(--nx-radius-sm) 0 0 var(--nx-radius-sm);
    border-right: 0;
}

.nx-price-box .input-group-prepend + input[type="number"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.nx-price-box .input-group-append .input-group-text {
    border-radius: 0 var(--nx-radius-sm) var(--nx-radius-sm) 0;
    border-left: 0;
}

.nx-price-box .input-group:has(.input-group-append) input[type="number"] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.nx-margin-live { display: flex; flex-direction: column; line-height: 1.05; }

.nx-margin-value {
    font-size: 2rem;
    font-weight: 680;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    color: var(--nx-text);
}

.nx-margin-value.is-green { color: var(--nx-green); }
.nx-margin-value.is-red { color: var(--nx-red); }
.nx-margin-value.is-empty { color: var(--nx-grey); }

.nx-margin-caption {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nx-faint);
    margin-top: .15rem;
}

.nx-margin-refs {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    font-size: .76rem;
    color: var(--nx-muted);
    white-space: nowrap;
}

@media (max-width: 1599.98px) {
    .nx-margin-refs + .nx-margin-refs { border-left: 0; padding-left: 0; }
}

.nx-margin-refs b { color: var(--nx-text); font-variant-numeric: tabular-nums; }

.nx-margin-refs + .nx-margin-refs {
    border-left: 1px solid var(--nx-border);
    padding-left: 1rem;
}

.nx-margin-refs-head {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--nx-faint);
}

.nx-margin-n { font-size: .68rem; color: var(--nx-faint); }

.nx-clickable {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color .12s ease, color .12s ease;
}

.nx-clickable:hover,
.nx-clickable:focus-visible {
    border-bottom-color: currentColor;
    outline: none;
}

/* The required marker targets direct label children, which the box nesting breaks. */
.form-group.required .nx-price-label::after { content: " *"; color: red; }

/* --- Close assistant drop zone --- */
.nx-dash .nx-drop {
    border: 2px dashed var(--nx-border);
    border-radius: var(--nx-radius-sm);
    background: var(--nx-bg-soft);
    padding: 1.15rem 1rem;
    text-align: center;
    color: var(--nx-muted);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}

.nx-dash .nx-drop.is-over {
    border-color: var(--nx-blue);
    background: var(--nx-blue-soft);
}

.nx-dash .nx-drop-icon {
    display: block;
    font-size: 1.4rem;
    color: var(--nx-faint);
    margin-bottom: .2rem;
}

/* --- Form cards: no table, so no horizontal scrollbar --- */
.nx-dash-embed .nx-card.nx-card-form > .card-body { overflow-x: visible; }

.nx-dash-embed .nx-card { margin-bottom: 0; }

/* One rhythm for a stack of cards. Livewire roots are unwrapped with display:contents,
   otherwise their nesting would swallow the gap. */
.nx-dash.nx-stack {
    display: flex;
    flex-direction: column;
    gap: var(--nx-gap);
}

.nx-stack > .nx-dash-embed { display: contents; }
.nx-stack .nx-card { margin: 0; }

/* Beats the dashboard default of padding:0, which exists for edge-to-edge lists. */
.nx-dash .card.nx-card.nx-card-form > .card-body { padding: var(--nx-pad); }

/* The card clips its corners, which would cut off an open dropdown. Rounding the
   header and footer instead keeps the shape without clipping. */
.nx-dash .card.nx-card.nx-card-form { overflow: visible; }

.nx-dash .card.nx-card.nx-card-form > .card-header {
    border-top-left-radius: var(--nx-radius);
    border-top-right-radius: var(--nx-radius);
}

.nx-dash .card.nx-card.nx-card-form > .card-footer {
    border-bottom-left-radius: var(--nx-radius);
    border-bottom-right-radius: var(--nx-radius);
}

.nx-dash .nx-card-form > .card-body { padding: var(--nx-pad); }

.nx-dash .nx-card-form > .card-footer {
    background: var(--nx-bg-soft);
    border-top: 1px solid var(--nx-border);
    padding: .75rem var(--nx-pad);
}

/* Grid without Bootstrap's negative row margins, which push labels out of the card. */
.nx-dash .nx-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: .85rem 1rem;
}

.nx-dash .nx-form-grid > .nx-f3  { grid-column: span 3; }
.nx-dash .nx-form-grid > .nx-f4  { grid-column: span 4; }
.nx-dash .nx-form-grid > .nx-f6  { grid-column: span 6; }
.nx-dash .nx-form-grid > .nx-f8  { grid-column: span 8; }
.nx-dash .nx-form-grid > .nx-f12 { grid-column: span 12; }

@media (max-width: 767.98px) {
    .nx-dash .nx-form-grid > [class*="nx-f"] { grid-column: span 12; }
}

.nx-dash .nx-field { min-width: 0; }
.nx-dash .nx-field.nx-field-end { align-self: end; }

.nx-dash .nx-field > label {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nx-faint);
    margin-bottom: .3rem;
}

/* A checkbox is its own label and must not inherit the field-label look. */
.nx-dash .nx-field > label.nx-check-inline {
    display: flex;
    align-items: center;
    gap: .45rem;
    height: 38px;
    margin-bottom: 0;
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--nx-text);
    cursor: pointer;
}

.nx-dash .nx-field > label.nx-check-inline input { margin: 0; }

.nx-dash .nx-field .form-control,
.nx-dash .nx-field select.form-control {
    height: 38px;
    border-radius: var(--nx-radius-sm);
    border-color: var(--nx-border);
    font-size: .875rem;
}

.nx-dash .nx-field textarea.form-control { height: auto; }

.nx-dash .nx-field .form-control:focus {
    border-color: var(--nx-blue);
    box-shadow: 0 0 0 3px var(--nx-blue-soft);
}

/* Read-only value that lines up with the inputs next to it */
.nx-dash .nx-static {
    display: flex;
    align-items: center;
    height: 38px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--nx-text);
}

.nx-dash .nx-static.is-empty { color: var(--nx-faint); font-weight: 500; }

.nx-dash .nx-hint {
    display: block;
    margin-top: .3rem;
    font-size: .72rem;
    color: var(--nx-faint);
}

.nx-dash .nx-delay-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .35rem;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}

.nx-dash .nx-delay-pill.is-late  { background: var(--nx-red-soft);   color: var(--nx-red); }
.nx-dash .nx-delay-pill.is-early { background: var(--nx-blue-soft);  color: var(--nx-blue); }
.nx-dash .nx-delay-pill.is-ontime{ background: var(--nx-green-soft); color: var(--nx-green); }

.nx-dash .nx-req { color: var(--nx-red); }

.nx-dash .nx-ata-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}

.nx-dash .nx-now {
    border: 0;
    background: transparent;
    padding: 0;
    margin-top: .35rem;
    font-size: .72rem;
    color: var(--nx-blue);
    text-decoration: underline dotted;
}

.nx-dash .nx-now:hover { text-decoration: underline; }

/* --- Searchable select --- */
.nx-dash .nx-combo { position: relative; }

.nx-dash .nx-combo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    height: 38px;
    padding: 0 .6rem;
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    font-size: .875rem;
    color: var(--nx-text);
    text-align: left;
}

.nx-dash .nx-combo-btn.is-open { border-color: var(--nx-blue); box-shadow: 0 0 0 3px var(--nx-blue-soft); }
.nx-dash .nx-combo-btn i { color: var(--nx-faint); font-size: .8rem; flex: none; }

.nx-dash .nx-combo-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nx-dash .nx-combo-value.is-empty { color: var(--nx-faint); }

.nx-dash .nx-combo-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    box-shadow: var(--nx-shadow);
    overflow: hidden;
}

.nx-dash .nx-combo-search {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--nx-border);
    padding: .5rem .6rem;
    font-size: .82rem;
    outline: none;
}

.nx-dash .nx-combo-list {
    list-style: none;
    margin: 0;
    padding: .25rem;
    max-height: 260px;
    overflow-y: auto;
}

.nx-dash .nx-combo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 6px;
    font-size: .82rem;
    cursor: pointer;
}

.nx-dash .nx-combo-item:hover { background: var(--nx-bg-soft); }
.nx-dash .nx-combo-item.is-selected { background: var(--nx-blue-soft); color: var(--nx-blue); font-weight: 600; }
.nx-dash .nx-combo-item small { color: var(--nx-faint); font-size: .68rem; flex: none; }

.nx-dash .nx-combo-empty {
    list-style: none;
    padding: .5rem;
    font-size: .8rem;
    color: var(--nx-faint);
    text-align: center;
}

[x-cloak] { display: none !important; }

.nx-dash .nx-divider {
    border: 0;
    border-top: 1px solid var(--nx-border);
    margin: 1rem 0 .9rem;
}

/* Attachment list */
.nx-dash .nx-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .4rem .6rem;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    background: #fff;
    font-size: .82rem;
}

.nx-dash .nx-file-row + .nx-file-row { margin-top: .35rem; }
.nx-dash .nx-file-row a { color: var(--nx-text); text-decoration: none; min-width: 0; }
.nx-dash .nx-file-row a:hover { color: var(--nx-blue); }
.nx-dash .nx-file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nx-dash .nx-icon-btn {
    border: 0;
    background: transparent;
    color: var(--nx-faint);
    padding: .15rem .3rem;
    line-height: 1;
    border-radius: 6px;
}

.nx-dash .nx-icon-btn:hover { color: var(--nx-red); background: var(--nx-red-soft); }

/* Party blocks inside the final charges / settlement cards */
.nx-dash .nx-party {
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    overflow: hidden;
}

.nx-dash .nx-party + .nx-party { margin-top: .85rem; }

.nx-dash .nx-party-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .5rem .7rem;
    background: var(--nx-bg-soft);
    border-bottom: 1px solid var(--nx-border);
}

.nx-dash .nx-party-name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--nx-text);
}

.nx-dash .nx-party-head .nx-head-icon {
    width: 28px;
    height: 28px;
    font-size: .9rem;
}

.nx-dash .nx-party-body { padding: .6rem .7rem 0; }
.nx-dash .nx-party-body > .table { margin-bottom: .6rem; }


/* ============================================================
   Reports
   ============================================================ */

.nx-dash .nx-form-grid > .nx-f2 { grid-column: span 2; }

/* Always three per row, so the 3/6/9 widget matrix stays even. */
.nx-report-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1199px) {
    .nx-report-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .nx-report-widgets { grid-template-columns: minmax(0, 1fr); }
}

.nx-dash .card.nx-card.nx-report-widget { margin: 0; }

/* The dashboard sets card bodies to padding 0 for edge-to-edge lists, so the
   widget rules need the same specificity to win. */
.nx-dash .card.nx-card.nx-report-widget > .card-body {
    padding: var(--nx-pad);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 172px;
}

.nx-dash .card.nx-card.nx-report-widget > .card-header {
    padding: var(--nx-pad) var(--nx-pad) .65rem;
    border-bottom: 0;
}

.nx-dash .card.nx-card.nx-report-widget.nx-chart-card > .card-body {
    padding: 0 var(--nx-pad) var(--nx-pad);
}

.nx-report-canvas {
    position: relative;
    flex: 1;
    min-height: 172px;
}

.nx-report-canvas > canvas { max-height: 100%; }

.nx-report-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 172px;
    color: var(--nx-faint);
    font-size: .82rem;
}

.nx-report-empty > i { font-size: 1.6rem; opacity: .45; }

/* ---- Number tiles ---- */

.nx-dash .nx-report-kpi {
    justify-content: center;
    gap: .15rem;
}

.nx-report-kpi-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .6rem;
}

.nx-report-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--nx-radius-sm);
    background: var(--nx-green-soft);
    color: var(--nx-green);
    font-size: 1rem;
    flex: 0 0 34px;
}

.nx-report-kpi-label {
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nx-muted);
}

.nx-dash .nx-report-kpi-value {
    font-size: 2.3rem;
    font-weight: 680;
    line-height: 1.05;
    letter-spacing: -.02em;
    color: var(--nx-text);
    font-variant-numeric: tabular-nums;
}

.nx-dash .nx-report-kpi-value.is-negative { color: #B91C1C; }

.nx-dash .nx-report-kpi-caption {
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--nx-muted);
}

/* The result table is wide by design; it scrolls inside its card. */
.nx-report-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.nx-dash .nx-report-table {
    font-size: .82rem;
    white-space: nowrap;
}

.nx-dash .nx-report-table > thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--nx-surface-2, #f7f8fa);
    border-bottom: 1px solid var(--blade-border);
    font-weight: 600;
    color: var(--nx-muted);
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .02em;
}

.nx-dash .nx-report-table > tbody td { vertical-align: middle; }

.nx-report-exports {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.nx-dash .nx-report-exports .btn { white-space: nowrap; }

/* ---- Footer / pagination ---- */

.nx-dash .nx-card > .card-footer.nx-report-foot {
    padding: .7rem var(--nx-pad);
}

.nx-report-foot > div { width: 100%; }
.nx-report-foot p { margin: 0; font-variant-numeric: tabular-nums; }
.nx-report-foot .pagination { margin: 0; gap: 4px; }

.nx-report-foot .page-link {
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    padding: .25rem .6rem;
    font-size: .8rem;
    color: var(--nx-muted);
    background: #fff;
    box-shadow: none;
}

.nx-report-foot .page-link:hover { background: var(--nx-bg-soft); color: var(--nx-text); }

.nx-report-foot .page-item.active .page-link {
    background: var(--nx-text);
    border-color: var(--nx-text);
    color: #fff;
}

.nx-report-foot .page-item.disabled .page-link { opacity: .45; }

/* Laravel's default paginator ships oversized inline SVG arrows; this view
   uses text labels instead, so any stray icon is hidden. */
.nx-report-foot .page-link svg { display: none; }
