/* Deliveries Inbound sub-tab (PG dispatch sign-off) */

.di-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.di-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.di-topbar-left h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
}
.di-topbar-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6c757d;
}
.di-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.di-topbar-leading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.di-inbound-panel .di-topbar-leading > .di-btn {
    flex-shrink: 0;
    margin-top: 2px;
}

/*
 * Inbound palette — linked to .delivery-sub-tab-inbound
 * Tab wash: #ccfbf1 · active: #5eead4 · text: #0f766e · grey chrome for calm rows
 */
.di-inbound-panel {
    background: #ccfbf1;
    border: 1px solid #5eead4;
    border-radius: 8px;
    padding: 14px 14px 18px;
}
.di-inbound-panel .di-topbar-left h2 {
    color: #0f766e;
}
.di-inbound-panel .di-topbar-sub,
.di-inbound-panel .di-hide-complete,
.di-inbound-panel .di-hide-rejected {
    color: #64748b;
}
.di-inbound-panel .di-table-wrap {
    background: #f8fafc;
    border-color: #5eead4;
}
.di-inbound-panel .di-table th {
    background: #e2e8f0;
    color: #475569;
    border-bottom-color: #cbd5e1;
}
.di-inbound-panel .di-table td {
    border-bottom-color: #e2e8f0;
    color: #334155;
}
.di-inbound-panel .di-table tr:hover td {
    background: #f0fdfa;
}
.di-inbound-panel .di-table tr.di-row-complete td,
.di-inbound-panel .di-table tr.di-row-complete:hover td {
    background: #f1f5f9;
}
.di-inbound-panel .di-table tr.di-row-partial td,
.di-inbound-panel .di-table tr.di-row-over td {
    background: #f8fafc;
}
.di-inbound-panel .di-btn {
    color: #0f766e;
    border-color: #5eead4;
    background: #fff;
}
.di-inbound-panel .di-btn:hover:not(:disabled) {
    background: #99f6e4;
    border-color: #14b8a6;
}
.di-inbound-panel .di-btn-success {
    background: #14b8a6;
    border-color: #0d9488;
    color: #fff;
}
.di-inbound-panel .di-btn-success:hover:not(:disabled) {
    background: #0d9488;
}
/* Keep intentional deep-link highlight calm (no yellow flash) */
.di-inbound-panel .di-table tbody tr.di-row-focus td {
    background: #99f6e4 !important;
    box-shadow: inset 0 0 0 1px #14b8a6;
    animation: none;
}
.di-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #334155;
}
.di-btn:hover:not(:disabled) {
    background: #f8fafc;
}
.di-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.di-btn-success {
    background: #10b981;
    border-color: #059669;
    color: #fff;
}
.di-btn-success:hover:not(:disabled) {
    background: #059669;
}

/* Print checklist modal */
.di-print-intro {
    margin: 0 0 14px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}
.di-print-select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
}
.di-print-custom-dates {
    margin-top: 4px;
}
.di-print-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.di-print-count {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
}

.di-hide-complete {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.di-table-wrap {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: auto;
    background: #fff;
    max-height: calc(100vh - 380px);
}
.di-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.di-table th,
.di-table td {
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    padding: 8px 10px;
    vertical-align: middle;
}
.di-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    position: sticky;
    top: 0;
    z-index: 1;
}
.di-table tr.di-row-complete td {
    background: #f0fdf4;
}
.di-table tr.di-row-partial td {
    background: #fff7ed;
}
.di-table tr.di-row-over td {
    background: #fffbeb;
}
.di-table tr:hover td {
    background: #f8fafc;
}
.di-table tr.di-row-complete:hover td {
    background: #dcfce7;
}
.di-table tbody tr.di-row-focus td {
    background: #fff3cd !important;
    box-shadow: inset 0 0 0 1px #ffc107;
    animation: di-row-focus-pulse 0.9s ease-in-out 2;
}
@keyframes di-row-focus-pulse {
    0%, 100% { background-color: #fff3cd; }
    50% { background-color: #ffe69c; }
}
.di-col-check {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}
.di-col-check-header {
    width: 130px;
    min-width: 130px;
    text-align: center;
    vertical-align: bottom;
    padding: 6px 8px !important;
}
.di-col-check-header .di-btn-signoff-col {
    display: block;
    width: 100%;
    font-size: 11px;
    padding: 5px 6px;
    line-height: 1.2;
    white-space: normal;
}
.di-filter-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.di-hide-complete,
.di-hide-rejected {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}
.di-btn-undo {
    border: 1px solid #64748b;
    background: #f1f5f9;
    color: #334155;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.di-btn-undo:hover {
    background: #e2e8f0;
}
.di-confirm-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    white-space: pre-line;
}
.di-table tr.di-row-rejected td {
    background: #fef2f2;
}
.di-col-actions {
    white-space: nowrap;
}
.di-stock-cell {
    font-size: 12px;
}
.di-date-cell {
    color: #6c757d;
    font-size: 12px;
    white-space: nowrap;
}

.di-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.di-badge-inbound { background: #dbeafe; color: #1d4ed8; }
.di-badge-pending { background: #f1f5f9; color: #64748b; }
.di-badge-accepted,
.di-badge-shipped { background: #d1fae5; color: #065f46; }
.di-badge-rejected,
.di-badge-returned { background: #fee2e2; color: #991b1b; }
.di-badge-complete { background: #bbf7d0; color: #14532d; }
.di-badge-partial { background: #fed7aa; color: #7c2d12; }
.di-badge-over { background: #fef9c3; color: #713f12; border: 1px solid #fbbf24; }
.di-badge-under { background: #ffe4e6; color: #9f1239; border: 1px solid #fca5a5; }

.di-btn-okay {
    border: 1px solid #059669;
    background: #10b981;
    color: #fff;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 4px;
}
.di-btn-okay:hover {
    background: #059669;
}
.di-btn-disc {
    border: 1px solid #d97706;
    background: #f59e0b;
    color: #fff;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.di-btn-disc:hover {
    background: #d97706;
}

.di-empty {
    text-align: center;
    padding: 28px;
    color: #6c757d;
}
.di-loading {
    text-align: center;
    padding: 28px;
    color: #6c757d;
}
.di-error {
    text-align: center;
    padding: 28px;
    color: #dc3545;
}

/* Modals */
.di-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 11000;
    align-items: center;
    justify-content: center;
}
.di-overlay.open {
    display: flex;
}
.di-modal {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    width: 540px;
    max-width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.di-modal-narrow {
    width: 460px;
}
.di-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e6e9f0;
}
.di-modal-head h2 {
    margin: 0;
    font-size: 16px;
}
.di-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    padding: 0 4px;
}
.di-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}
.di-modal-foot {
    padding: 12px 16px;
    border-top: 1px solid #e6e9f0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}
.di-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.di-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.di-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.di-form-group input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}
.di-signoff-detail {
    background: #f8fafc;
    border: 1px solid #e6e9f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}
.di-signoff-detail .di-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #e6e9f0;
}
.di-signoff-detail .di-detail-row:last-child {
    border-bottom: none;
}
.di-signoff-detail .di-detail-row span:first-child {
    color: #64748b;
    font-weight: 500;
}
.di-signoff-detail .di-detail-row span:last-child {
    font-weight: 600;
}
.di-alloc-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
}
.di-btn-danger {
    background: #ef4444;
    border-color: #dc2626;
    color: #fff;
}
.di-btn-warn {
    background: #f59e0b;
    border-color: #d97706;
    color: #fff;
}
