﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Partner Manager Card List ─────────────────────────────────────────── */
.pm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.pm-row {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    padding: 12px;
}

.pm-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pm-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    min-width: 220px;
    flex-wrap: wrap;
}

.pm-row-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
    flex-shrink: 0;
}

.pm-row-dot.inactive {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.pm-row-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a3a6b;
    line-height: 1.4;
}

.pm-row-meta {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

.pm-row-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
}

.pm-row-field {
    min-width: 160px;
    flex: 1 1 160px;
}

.pm-row-field-wide {
    flex: 1 1 100%;
}

.pm-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: visible !important;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
}

.pm-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.pm-card-header {
    padding: 12px;
    background: linear-gradient(135deg, #f0f4f9 0%, #e8edf5 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-card-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a3a6b;
    flex: 1;
    word-break: break-word;
    line-height: 1.4;
}

.pm-card-active {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

.pm-card-active.inactive {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.pm-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.pm-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    line-height: 1;
}

.pm-field-value {
    font-size: 13px;
    color: #374151;
    word-break: break-word;
    line-height: 1.4;
    white-space: normal;
    overflow: visible !important;
    max-height: none !important;
}

.pm-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pm-role-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e5e7eb;
    color: #374151;
    white-space: nowrap;
    line-height: 1.4;
}

.pm-role-badge.customer  { background: #dbeafe; color: #1e40af; }
.pm-role-badge.shipper   { background: #dcfce7; color: #166534; }
.pm-role-badge.consignee { background: #cffafe; color: #0c4a6e; }
.pm-role-badge.agent     { background: #fef3c7; color: #78350f; }
.pm-role-badge.carrier   { background: #f3e8ff; color: #581c87; }
.pm-role-badge.forwarder { background: #fee2e2; color: #7c2d12; }
.pm-role-badge.notify    { background: #f1f5f9; color: #1e293b; }
.pm-role-badge.other     { background: #f3f4f6; color: #4b5563; }

.pm-card-footer {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 0 0 8px 8px;
    background: #fafafa;
}

@media (max-width: 768px) {
    .pm-list {
        gap: 10px;
    }

    .pm-row {
        padding: 10px;
    }

    .pm-row-details {
        gap: 6px 12px;
    }

    .pm-field-value {
        font-size: 12px;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 480px) {
    .pm-list { gap: 8px; }

    .pm-row {
        padding: 8px;
    }

    .pm-row-title {
        min-width: 0;
    }

    .pm-row-details {
        gap: 6px 10px;
    }
}

/* ── Mobile Menu Fix - improve touch targets and click handling ── */
@media (max-width: 1200px) {
    /* MudNavLink: increase touch target size */
    .mud-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 8px 16px;
        cursor: pointer;
    }

    /* MudNavGroup: better mobile spacing */
    .mud-nav-group {
        padding: 4px 0;
    }

    .mud-nav-group-header {
        min-height: 44px;
        padding: 8px 16px;
    }

    /* Drawer overlay: clickable to close on mobile */
    .mud-drawer-overlay {
        cursor: pointer;
    }

    /* Fix z-index issues */
    .mud-drawer {
        z-index: 1100 !important;
    }

    .mud-drawer-overlay {
        z-index: 1099 !important;
    }
}

@media (max-width: 768px) {
    /* Mobile: enforce minimum touch targets */
    .mud-nav-link,
    .mud-nav-group-header {
        min-height: 48px !important;
        padding: 12px 16px !important;
    }

    /* Close drawer when clicking overlay on mobile */
    .mud-overlay-dark {
        z-index: 1099 !important;
    }

    /* Prevent drawer from being too wide on mobile */
    .mud-drawer {
        max-width: 85vw !important;
    }
}

/* ── Mobile Responsive - MudBlazor improvements ── */
@media (max-width: 768px) {
    /* Modals: fullscreen on mobile */
    div[style*="position:fixed"][style*="z-index"] > div[style*="max-width"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        margin: 0 !important;
    }

    /* MudPaper modals: stack vertically */
    .mud-paper[style*="max-width"] {
        max-width: calc(100vw - 16px) !important;
    }

    /* MudToolbar: smaller padding on mobile */
    .mud-toolbar {
        min-height: 40px !important;
        padding: 4px 8px !important;
    }

    /* MudText h6 in toolbar: smaller font */
    .mud-toolbar .mud-text-h6 {
        font-size: 1rem !important;
    }

    /* MudStack: wrap all items on mobile */
    .mud-stack-row {
        flex-wrap: wrap !important;
    }

    /* MudSelect/MudDatePicker: full width on mobile */
    .mud-select, .mud-picker-container {
        min-width: auto !important;
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    /* MudButton: responsive sizing */
    .mud-button-root {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mud-button-root.mud-size-small {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
    }

    /* Grid items: stack on mobile */
    .mud-grid-item[style*="md"] {
        flex-basis: 100% !important;
    }

    /* Modal body: remove max-height constraints */
    .modal-body, div[style*="max-height"] {
        max-height: auto !important;
    }

    /* Tables: scroll on mobile */
    table {
        font-size: 0.85rem;
    }

    table td, table th {
        padding: 4px 2px !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .mud-button-root {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }

    .mud-toolbar .mud-text-h6 {
        font-size: 0.9rem !important;
    }

    /* Hide some columns on very small screens */
    .d-none-mobile {
        display: none !important;
    }

    /* MudChip: smaller on mobile */
    .mud-chip {
        font-size: 0.7rem !important;
        height: 24px !important;
        padding: 0 6px !important;
    }

    /* Badge: smaller on mobile */
    .badge {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }
}

/* ── NavMenu active link styling (global) - Multiple selectors for high specificity ── */
.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link.active:not(.mud-nav-link-disabled),
.mud-navmenu .mud-nav-link.active,
.mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled),
.mud-navmenu.mud-navmenu-default .mud-nav-link.active,
.mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled),
.mud-nav-link.active {
    color: rgb(247, 209, 6) !important;
    background-color: rgba(255,255,255,0.15) !important;
    font-weight: 800 !important;
}

/* Also override .mud-selected if MudBlazor uses it */
.mud-drawer .mud-nav-link.mud-selected,
.mud-navmenu .mud-nav-link.mud-selected {
    color: rgb(247, 209, 6) !important;
    background-color: rgba(255,255,255,0.15) !important;
    font-weight: 800 !important;
}

/* ── Modal overlay positioning (prevents AppBar + Drawer overlap) ── */
div[style*="position:fixed"][style*="z-index:105"] {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200 !important;
}

/* ── Responsive modal width ── */
@media (max-width: 768px) {
    div[style*="position:fixed"][style*="z-index:105"] > :is(div, [class*="MudPaper"]) {
        max-width: calc(100% - 32px) !important;
    }
}

/* ── ExchangeRateModal z-index fix: ensure it appears above charge edit modal (z-index:1050) ── */
.modal.show {
    z-index: 1051 !important;
}

.modal-backdrop.show {
    z-index: 1050 !important;
}

/* ── Shared item-list card layout (il-*) used by sub-list components ─── */
.il-list { display: flex; flex-direction: column; gap: 10px; }

.il-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.il-card.il-deviation-bad { background-color: #f8d7da !important; }

.il-header {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px; margin-bottom: 6px;
    padding-bottom: 6px; border-bottom: 1px solid #f0f0f0;
}
.il-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.il-fields { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.il-f {
    display: flex; flex-direction: column;
    min-width: 100px;
    font-size: 12px;
}
.il-f label  { color: #6c757d; font-size: 11px; margin-bottom: 1px; }
.il-f span   { font-weight: 500; word-break: break-word; }
.il-f-wide   { min-width: 220px; flex: 1 1 100%; }

.il-grp { margin-bottom: 6px; }
.il-grp-title {
    font-size: 11px; font-weight: 600; color: #6366f1;
    text-transform: uppercase; margin-bottom: 3px;
}
.il-total {
    font-weight: 600; margin-top: 10px;
    padding: 8px 12px; background: #f8f9fa;
    border-radius: 6px; font-size: 13px;
    border: 1px solid #e9ecef;
}
/* Pending-item card (for voucher queues) */
.il-pending { background: #fffbf0; border-color: #fde68a; }
/* ── End il-* ─────────────────────────────────────────────────────────── */

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg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
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
.username-text {
    font-size: 1.1rem; /* to hơn chút */
    font-weight: 600; /* đậm hơn */
    color: #0056b3; /* xanh đậm hơn so với text-primary */
}

/* ===== Shipment Wizard ===== */
.shipment-wizard .wizard-steps {
    position: relative;
}

.shipment-wizard .wizard-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #dee2e6;
    z-index: 0;
}

.shipment-wizard .wizard-step {
    position: relative;
    z-index: 1;
}

.shipment-wizard .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.shipment-wizard .wizard-step.pending .step-circle {
    background: #e9ecef;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.shipment-wizard .wizard-step.active .step-circle {
    background: #0d6efd;
    color: #fff;
    border: 2px solid #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

.shipment-wizard .wizard-step.completed .step-circle {
    background: #198754;
    color: #fff;
    border: 2px solid #198754;
}

.shipment-wizard .step-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.shipment-wizard .wizard-step.active .step-label {
    color: #0d6efd;
    font-weight: 600;
}

.shipment-wizard .wizard-step.completed .step-label {
    color: #198754;
}



/* ── Customs Declaration (CD) tables — global (tránh Blazor CSS isolation scoping issue trên IIS) ── */
.cd-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.cd-tbl td { border: 1px solid #999; padding: 3px 6px; vertical-align: top; }
.cd-c1 { background: #f3f4f6; font-size: 10px; white-space: nowrap; width: 110px; }
.cd-v { min-width: 80px; }
.cd-hd { background: #1e3a5f; color: #fff; font-weight: 700; font-size: 11px; padding: 4px 8px; text-align: center; }
.cd-hd-row td { padding: 0; }
.cd-ok { color: #166534; font-weight: 700; }
.cd-hi { font-weight: 700; color: #1d4ed8; }
.cd-sec { background: #374151; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; margin-top: 6px; letter-spacing: .5px; }
