﻿/*
 * dr-import-modal.css
 * Full replacement styles for the POS PDF import modal, pending-review flow,
 * post-import form highlights, and manual-entry attention banner.
 *
 * Naming convention:
 *   - pos-* for modal internals
 *   - dr-*  for Daily Report / form-level elements
 *
 * This file is intentionally self-contained and does not rely on theme CSS variables.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   Import button in card/header
   ═══════════════════════════════════════════════════════════════════════════ */

.dr-pos-import-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-left: auto;
    margin-right: 0.5rem;
    padding: 0.32rem 0.82rem;
    min-height: 2rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

    .dr-pos-import-btn:hover:not(:disabled) {
        color: #1e40af;
        background: #dbeafe;
        border-color: #93c5fd;
        box-shadow: 0 1px 4px rgba(29, 78, 216, 0.12);
    }

    .dr-pos-import-btn:active:not(:disabled) {
        background: #bfdbfe;
        box-shadow: none;
    }

    .dr-pos-import-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    }

    .dr-pos-import-btn:disabled {
        opacity: 0.48;
        cursor: not-allowed;
        box-shadow: none;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Form-level post-import highlights
   ═══════════════════════════════════════════════════════════════════════════ */

.dr-input--needs-entry {
    border-color: #d97706 !important;
    background-color: #fffbeb !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

    .dr-input--needs-entry:focus {
        border-color: #b45309 !important;
        background-color: #fef3c7 !important;
        box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.18) !important;
    }

    .dr-input--needs-entry::placeholder {
        color: #b45309;
        opacity: 0.72;
    }

/* Attention banner shown after import when fields need manual entry */
.pos-attention-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
    padding: 0.82rem 1rem;
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    border-radius: 9px;
    font-size: 0.82rem;
    line-height: 1.5;
}

    .pos-attention-banner[hidden] {
        display: none !important;
    }

.pos-attention-icon {
    flex: 0 0 auto;
    margin-top: 0.08rem;
    font-size: 1rem;
    line-height: 1;
}

.pos-attention-text {
    flex: 1 1 auto;
    min-width: 0;
}

.pos-attention-dismiss {
    flex: 0 0 auto;
    padding: 0.17rem 0.42rem;
    color: #92400e;
    background: transparent;
    border: 1px solid #fcd34d;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0.82;
    transition: opacity 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

    .pos-attention-dismiss:hover {
        opacity: 1;
        background: #fef3c7;
    }

    .pos-attention-dismiss:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Modal overlay and shell
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 1.25rem;
    background: rgba(2, 6, 23, 0.54);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

    .pos-modal-overlay[hidden] {
        display: none !important;
    }

.pos-modal {
    width: 100%;
    max-width: 740px;
    max-height: min(96vh, 980px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.03), 0 10px 24px rgba(15, 23, 42, 0.10), 0 32px 72px rgba(15, 23, 42, 0.22);
    animation: posModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.pos-modal-overlay[data-mode="pending"] .pos-modal {
    max-width: 740px;
}

@keyframes posModalIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pos-modal::-webkit-scrollbar {
    width: 6px;
}

.pos-modal::-webkit-scrollbar-track {
    background: transparent;
}

.pos-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

    .pos-modal::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Mode visibility controlled by JS setModalMode(mode) on #posImportModal */
.pos-modal-overlay[data-mode="create"] [data-pos-mode-only="pending"],
.pos-modal-overlay[data-mode="pending"] [data-pos-mode-only="create"] {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modal header
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.28rem 1.55rem 1.05rem;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.025);
}

.pos-modal-icon {
    flex: 0 0 auto;
    margin-top: 0.18rem;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.88;
}

.pos-modal-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.pos-modal-title {
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.pos-modal-subtitle {
    margin-top: 0.18rem;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 450;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-modal-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-top: -0.15rem;
    padding: 0;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.12rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

    .pos-modal-close:hover {
        color: #0f172a;
        background: #f8fafc;
        border-color: #e2e8f0;
    }

    .pos-modal-close:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Modal body and footer
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 1.25rem 1.55rem 1.35rem;
    background: #ffffff;
}

.pos-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.95rem 1.55rem;
    background: #ffffff;
    border-top: 1px solid #eef2f7;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 -10px 18px rgba(15, 23, 42, 0.045);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Create-mode date row and match badge
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-date-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.pos-date-cell {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
}

.pos-date-label {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pos-date-value {
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.pos-date-divider {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
}

.pos-match-badge-wrap {
    flex: 0 0 auto;
}

.pos-match-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.27rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

    .pos-match-badge[hidden] {
        display: none !important;
    }

.pos-match-high {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.pos-match-mid {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.pos-match-low {
    color: #be123c;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Smart date context panel
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-date-context {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

    .pos-date-context[hidden] {
        display: none !important;
    }

.pos-dc-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.78rem 0.95rem;
}

.pos-dc-icon {
    flex: 0 0 auto;
    margin-top: 0.05rem;
    font-size: 1rem;
    line-height: 1;
}

.pos-dc-message {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.48;
}

    .pos-dc-message strong {
        font-weight: 750;
    }

.pos-dc-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.34rem 0.72rem;
    color: #ffffff;
    background: #4f46e5;
    border: 1px solid #4338ca;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

    .pos-dc-action:hover {
        background: #4338ca;
        border-color: #3730a3;
    }

    .pos-dc-action:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
    }

    .pos-dc-action[hidden] {
        display: none !important;
    }

.pos-date-note {
    padding: 0.52rem 0.75rem;
    color: #64748b;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 0.79rem;
    line-height: 1.45;
}

    .pos-date-note[hidden] {
        display: none !important;
    }

.pos-date-context--gap {
    background: #eef2ff;
    border-color: #c7d2fe;
}

    .pos-date-context--gap .pos-dc-header {
        background: #eef2ff;
    }

    .pos-date-context--gap .pos-dc-message {
        color: #3730a3;
        font-weight: 550;
    }

.pos-date-context--filed {
    background: #fff1f2;
    border-color: #fecdd3;
}

    .pos-date-context--filed .pos-dc-header {
        background: #fff1f2;
    }

    .pos-date-context--filed .pos-dc-message {
        color: #881337;
    }

        .pos-date-context--filed .pos-dc-message strong {
            display: block;
            margin-bottom: 0.18rem;
            color: #9f1239;
        }

.pos-date-context--offschedule {
    background: #fffbeb;
    border-color: #fcd34d;
}

    .pos-date-context--offschedule .pos-dc-header {
        background: #fffbeb;
    }

    .pos-date-context--offschedule .pos-dc-message {
        color: #78350f;
    }

/* Legacy mismatch panel, kept safe if markup still exists */
.pos-date-mismatch {
    margin-bottom: 0.75rem;
    padding: 0.72rem 0.95rem;
    color: #78350f;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    border-radius: 9px;
    font-size: 0.82rem;
    line-height: 1.5;
}

    .pos-date-mismatch[hidden] {
        display: none !important;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Section labels and parsed values grid
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-section-label {
    padding-bottom: 0.45rem;
    color: #64748b;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pos-values-grid {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0 0.35rem;
}

.pos-group-label {
    margin-top: 0.95rem;
    margin-bottom: 0.35rem;
    padding-left: 0.05rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.085em;
}

    .pos-group-label:first-child {
        margin-top: 0;
    }

.pos-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.6rem;
    row-gap: 0;
}

.pos-value-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.34rem 0;
    color: #334155;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.92rem;
    line-height: 1.35;
}

    .pos-value-item:last-child {
        border-bottom-color: transparent;
    }

.pos-value-label {
    flex: 1 1 auto;
    min-width: 0;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-value-num {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Pending/editable value grid */
.pos-value-input {
    width: 100%;
    min-width: 0;
    padding: 0.38rem 0.55rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

    .pos-value-input:hover {
        border-color: #94a3b8;
    }

    .pos-value-input:focus {
        outline: none;
        background: #ffffff;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

    .pos-value-input::placeholder {
        color: #9ca3af;
    }

.pos-modal-overlay[data-mode="pending"] .pos-values-grid {
    padding: 0;
}

.pos-modal-overlay[data-mode="pending"] .pos-group-grid {
    column-gap: 1.5rem;
}

.pos-modal-overlay[data-mode="pending"] .pos-value-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8.2rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.38rem 0;
}

    .pos-modal-overlay[data-mode="pending"] .pos-value-item .pos-value-label {
        min-width: 0;
        color: #475569;
        font-size: 0.84rem;
        font-weight: 600;
    }

    .pos-modal-overlay[data-mode="pending"] .pos-value-item .pos-value-input {
        width: 8.2rem;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Missing fields block
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-missing-block {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

    .pos-missing-block[hidden] {
        display: none !important;
    }

.pos-missing-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 0.95rem;
    background: #fffbeb;
    border-bottom: 1px solid #fcd34d;
}

.pos-missing-icon {
    flex: 0 0 auto;
    font-size: 0.92rem;
    line-height: 1;
}

.pos-missing-title {
    color: #78350f;
    font-size: 0.81rem;
    font-weight: 700;
    line-height: 1.35;
}

.pos-missing-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    padding: 0.78rem 0.95rem;
}

.pos-missing-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.62rem;
    color: #92400e;
    background: #ffffff;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Learning note
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-learning-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.82rem 0.95rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
}

    .pos-learning-note[hidden] {
        display: none !important;
    }

.pos-learning-icon {
    flex: 0 0 auto;
    margin-top: 0.08rem;
    font-size: 0.95rem;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Pending-review meta block
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-pending-meta {
    margin-bottom: 0.15rem;
    padding: 0.95rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.pos-pending-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.78rem;
}

    .pos-pending-row:last-child {
        margin-bottom: 0;
    }

    .pos-pending-row[hidden] {
        display: none !important;
    }

.pos-pending-field {
    flex: 1 1 0;
    min-width: 0;
}

.pos-pending-label {
    display: block;
    margin-bottom: 0.26rem;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.25;
}

.pos-pending-input {
    width: 100%;
    min-height: 2.15rem;
    padding: 0.42rem 0.58rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 550;
    line-height: 1.35;
    box-sizing: border-box;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

    .pos-pending-input:hover {
        border-color: #94a3b8;
    }

    .pos-pending-input:focus {
        outline: none;
        background: #ffffff;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

.pos-pending-hint {
    min-height: 1em;
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.35;
}

    .pos-pending-hint:empty {
        display: none;
    }

.pos-pending-sender {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    margin-top: 0.72rem;
    padding-top: 0.72rem;
    color: #475569;
    border-top: 1px dashed #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.4;
}

.pos-pending-sender-label {
    color: #94a3b8;
    font-weight: 700;
}

.pos-pending-pdf-link {
    margin-left: auto;
    color: #2563eb;
    font-weight: 650;
    text-decoration: none;
}

    .pos-pending-pdf-link:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

    .pos-pending-pdf-link[hidden] {
        display: none !important;
    }

.pos-pending-warning {
    margin-top: 0.72rem;
    padding: 0.62rem 0.75rem;
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
}

    .pos-pending-warning[hidden] {
        display: none !important;
    }

    .pos-pending-warning a {
        color: #1d4ed8;
        font-weight: 700;
        text-decoration: none;
    }

        .pos-pending-warning a:hover {
            text-decoration: underline;
        }

/* Discard panel */
.pos-pending-discard {
    margin-top: 0.95rem;
    padding: 0.95rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

    .pos-pending-discard[hidden] {
        display: none !important;
    }

    .pos-pending-discard .pos-pending-label {
        color: #991b1b;
    }

    .pos-pending-discard textarea,
    .pos-pending-discard .pos-pending-input {
        min-height: 5rem;
        resize: vertical;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons / danger button fallback
   ═══════════════════════════════════════════════════════════════════════════ */

.dr-btn-danger {
    color: #ffffff;
    background: #dc2626;
    border: 1px solid #b91c1c;
}

    .dr-btn-danger:hover:not(:disabled) {
        background: #b91c1c;
        border-color: #991b1b;
    }

    .dr-btn-danger:disabled,
    .dr-btn-danger[disabled] {
        color: #ffffff;
        background: #9ca3af;
        border-color: #9ca3af;
        cursor: not-allowed;
        opacity: 0.78;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Items-confirm dialog variant
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-modal-overlay--items-confirm {
    z-index: 10001;
}

.pos-modal--items-confirm {
    max-width: 470px;
}

    .pos-modal--items-confirm .pos-modal-body {
        padding: 1.18rem 1.45rem;
    }

.pos-confirm-text {
    margin: 0 0 0.75rem;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
}

    .pos-confirm-text:last-child {
        margin-bottom: 0;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Unknown POS panel
   ═══════════════════════════════════════════════════════════════════════════ */

.pos-unknown-panel {
    display: none;
}

    .pos-unknown-panel.is-visible {
        display: block;
    }

/* ═══════════════════════════════════════════════════════════════════════════
   Gap chip state claimed by posImport.syncGapChipSelection()
   ═══════════════════════════════════════════════════════════════════════════ */

.dr-gap-chip.dr-gap-chip-claimed {
    opacity: 0.5;
    text-decoration: line-through;
    cursor: default;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive behavior
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {
    .pos-modal-overlay[data-mode="pending"] .pos-modal,
    .pos-modal {
        max-width: 100%;
    }

    .pos-group-grid {
        grid-template-columns: 1fr;
    }

    .pos-modal-overlay[data-mode="pending"] .pos-group-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .pos-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .pos-modal {
        max-height: 94vh;
        border-right: none;
        border-bottom: none;
        border-left: none;
        border-radius: 14px 14px 0 0;
    }

    .pos-modal-header {
        padding: 1.08rem 1.15rem 0.88rem;
        border-radius: 14px 14px 0 0;
    }

    .pos-modal-title {
        font-size: 1rem;
    }

    .pos-modal-subtitle {
        font-size: 0.82rem;
    }

    .pos-modal-body {
        padding: 1.05rem 1.15rem 1.18rem;
    }

    .pos-modal-footer {
        flex-wrap: wrap;
        justify-content: stretch;
        padding: 0.9rem 1.15rem;
        border-radius: 0;
    }

        .pos-modal-footer .dr-btn,
        .pos-modal-footer button {
            flex: 1 1 auto;
        }

    .pos-date-row {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .pos-date-cell {
        flex: 1 1 calc(50% - 1rem);
    }

    .pos-date-divider {
        display: none;
    }

    .pos-match-badge-wrap {
        width: 100%;
    }

    .pos-match-badge {
        width: 100%;
    }

    .pos-dc-header {
        flex-wrap: wrap;
    }

    .pos-dc-action {
        width: 100%;
    }

    .pos-pending-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pos-pending-sender {
        align-items: flex-start;
        flex-direction: column;
    }

    .pos-pending-pdf-link {
        margin-left: 0;
    }

    .pos-modal-overlay[data-mode="pending"] .pos-value-item {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.3rem;
        padding: 0.5rem 0;
    }

        .pos-modal-overlay[data-mode="pending"] .pos-value-item .pos-value-input {
            width: 100%;
            text-align: left;
        }
}

@media (max-width: 420px) {
    .dr-pos-import-btn {
        padding-inline: 0.65rem;
    }

    .pos-modal-footer {
        gap: 0.5rem;
    }

        .pos-modal-footer .dr-btn,
        .pos-modal-footer button {
            flex-basis: 100%;
        }

    .pos-date-cell {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pos-modal {
        animation: none;
    }

    .dr-pos-import-btn,
    .dr-input--needs-entry,
    .pos-attention-dismiss,
    .pos-modal-close,
    .pos-dc-action,
    .pos-value-input,
    .pos-pending-input {
        transition: none;
    }
}
