/* =========================================================
   WooCommerce Frontend POS & Invoice Manager
   Full Dashboard CSS
   ========================================================= */

/* ---------- Base Layout ---------- */

.wcfpi-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
    box-sizing: border-box;
}

.wcfpi-wrap *,
.wcfpi-wrap *::before,
.wcfpi-wrap *::after {
    box-sizing: border-box;
}

.wcfpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.wcfpi-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
}

.wcfpi-header p {
    margin: 8px 0 0;
    color: #6b7280;
}

.wcfpi-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 14px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.wcfpi-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
}

.wcfpi-sidebar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    height: fit-content;
}

.wcfpi-tab-link {
    display: block;
    padding: 13px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
}

.wcfpi-tab-link:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.wcfpi-tab-link.is-active {
    background: #4f46e5;
    color: #ffffff;
}

.wcfpi-content {
    min-width: 0;
}

/* ---------- Cards ---------- */

.wcfpi-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.wcfpi-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.wcfpi-card h3 {
    margin-top: 0;
}

.wcfpi-card p {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 14px;
}

/* ---------- Dashboard Stats ---------- */

.wcfpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.wcfpi-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.wcfpi-stat-card span {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.wcfpi-stat-card strong {
    font-size: 28px;
}

/* ---------- Access Denied ---------- */

.wcfpi-access-denied {
    max-width: 720px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-weight: 600;
}

/* ---------- Sections ---------- */

.wcfpi-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.wcfpi-phase-active {
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}

.wcfpi-grid-2 {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ---------- Forms ---------- */

.wcfpi-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

.wcfpi-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    color: #374151;
    font-size: 14px;
}

.wcfpi-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.wcfpi-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.wcfpi-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.wcfpi-form input,
.wcfpi-form textarea,
.wcfpi-form select,
.wcfpi-field input,
.wcfpi-field select,
.wcfpi-field textarea,
.wcfpi-list-header input,
.wcfpi-toolbar input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #111827;
    outline: none;
}

.wcfpi-form input:focus,
.wcfpi-form textarea:focus,
.wcfpi-form select:focus,
.wcfpi-field input:focus,
.wcfpi-field select:focus,
.wcfpi-field textarea:focus,
.wcfpi-list-header input:focus,
.wcfpi-toolbar input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.wcfpi-full-field,
.wcfpi-field-full,
.wcfpi-form-actions {
    grid-column: 1 / -1;
}

.wcfpi-field-full {
    margin-top: 16px;
}

.wcfpi-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

/* ---------- Buttons ---------- */

.wcfpi-button,
a.wcfpi-button,
button.wcfpi-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.wcfpi-button:hover,
a.wcfpi-button:hover,
button.wcfpi-button:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.wcfpi-button-primary,
a.wcfpi-button-primary,
button.wcfpi-button-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.wcfpi-button-primary:hover,
a.wcfpi-button-primary:hover,
button.wcfpi-button-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
    color: #ffffff;
}

.wcfpi-button-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.wcfpi-button-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

#wcfpi-pos-next-step:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- Messages ---------- */

.wcfpi-message,
.wcfpi-alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 700;
}

.wcfpi-message.is-success,
.wcfpi-alert.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.wcfpi-message.is-error,
.wcfpi-alert.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ---------- List Header / Toolbar ---------- */

.wcfpi-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.wcfpi-list-header h3 {
    margin: 0;
}

.wcfpi-list-header input {
    max-width: 420px;
}

.wcfpi-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* ---------- Tables ---------- */

.wcfpi-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.wcfpi-table-wrap.is-dragging {
    cursor: grabbing;
}

.wcfpi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    margin: 0;
}

.wcfpi-table th,
.wcfpi-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.wcfpi-table th {
    background: #f9fafb;
    font-weight: 800;
    color: #374151;
    white-space: nowrap;
}

.wcfpi-table td {
    color: #111827;
}

.wcfpi-table tbody tr:hover {
    background: #f9fafb;
}

.wcfpi-table small {
    color: #6b7280;
    font-size: 11px;
}

/* ---------- Product Module ---------- */

.wcfpi-product-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wcfpi-status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.wcfpi-media-preview {
    min-height: 90px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin-bottom: 10px;
}

.wcfpi-media-preview img {
    max-width: 160px;
    max-height: 90px;
    object-fit: contain;
}

.wcfpi-media-preview span {
    color: #6b7280;
    font-size: 13px;
}

/* ---------- POS Layout ---------- */

.wcfpi-pos-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.wcfpi-pos-left,
.wcfpi-pos-right {
    min-width: 0;
}

.wcfpi-pos-cart-card {
    position: sticky;
    top: 20px;
}

.wcfpi-pos-search {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.wcfpi-pos-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
}

.wcfpi-pos-product-results,
.wcfpi-pos-customer-results {
    display: grid;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.wcfpi-pos-product-card {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.wcfpi-pos-product-card img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wcfpi-pos-product-info strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.wcfpi-pos-product-info span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.wcfpi-pos-product-action {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.wcfpi-pos-product-action strong {
    font-size: 16px;
}

.wcfpi-price-label {
    font-size: 12px;
    color: #6b7280;
}

.wcfpi-empty-state {
    padding: 18px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    color: #6b7280;
    text-align: center;
}

.wcfpi-pos-cart-table input {
    width: 86px;
    min-height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
}

.wcfpi-pos-summary {
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    display: grid;
    gap: 10px;
}

.wcfpi-pos-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wcfpi-pos-summary span {
    color: #4b5563;
}

.wcfpi-pos-summary strong {
    font-size: 16px;
}

.wcfpi-pos-summary-total {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
}

.wcfpi-pos-summary-total strong {
    font-size: 22px;
    color: #111827;
}

.wcfpi-pos-status-preview {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.wcfpi-pos-status-preview span {
    display: block;
    margin-top: 5px;
    color: #374151;
}

.wcfpi-small-note {
    margin-top: 12px;
    font-size: 13px;
    color: #6b7280;
}

/* ---------- Customer Results ---------- */

.wcfpi-customer-result-group {
    display: grid;
    gap: 10px;
}

.wcfpi-customer-result-group h4 {
    margin: 10px 0 0;
    font-size: 15px;
    color: #111827;
}

.wcfpi-pos-customer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.wcfpi-pos-customer-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.wcfpi-pos-customer-card span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

.wcfpi-selected-customer-box {
    margin-bottom: 16px;
}

.wcfpi-selected-customer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px;
    border-radius: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.wcfpi-selected-customer-inner strong {
    display: block;
    color: #065f46;
    margin-bottom: 5px;
}

.wcfpi-selected-customer-inner span {
    display: block;
    font-size: 13px;
    color: #047857;
    line-height: 1.5;
}

.wcfpi-matches {
    margin-top: 16px;
}

.wcfpi-match-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    background: #f9fafb;
}

/* ---------- Invoice Filter Shared ---------- */

.wcfpi-invoice-filter-form {
    margin: 18px 0 22px;
    padding: 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.wcfpi-invoice-filter-form .wcfpi-form-actions {
    margin-top: 12px;
}

/* =========================================================
   Important Final Overrides
   ========================================================= */

/* Full-width dashboard on desktop */
@media (min-width: 1024px) {
    .wcfpi-wrap {
        max-width: none !important;
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .wcfpi-content,
    .wcfpi-card,
    .wcfpi-invoices-page,
    .wcfpi-invoices-card,
    .wcfpi-table-wrap {
        max-width: none !important;
    }
}

/* Better customer form layout */
#wcfpi-pos-customer-form,
.wcfpi-pos-customer-form {
    max-width: 100%;
}

#wcfpi-pos-customer-form .wcfpi-form-grid,
.wcfpi-pos-customer-form .wcfpi-form-grid,
#wcfpi-pos-customer-form.wcfpi-form,
.wcfpi-pos-customer-form.wcfpi-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Keep invoice filters 4 columns only on desktop */
@media (min-width: 1101px) {
    .wcfpi-invoice-filter-form .wcfpi-form-grid,
    .wcfpi-invoice-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* POS should use more space on wide screens */
@media (min-width: 1280px) {
    .wcfpi-pos-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(460px, 0.75fr);
    }
}

/* Avoid cramped table cells */
.wcfpi-table th,
.wcfpi-table td {
    white-space: normal;
}

.wcfpi-table th {
    white-space: nowrap;
}

/* Forms should not become 4 columns everywhere */
.wcfpi-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .wcfpi-layout {
        grid-template-columns: 1fr;
    }

    .wcfpi-sidebar {
        position: static;
    }

    .wcfpi-sidebar {
        overflow-x: auto;
    }

    .wcfpi-tab-link {
        display: inline-flex;
        margin-right: 6px;
        white-space: nowrap;
    }

    .wcfpi-pos-grid {
        grid-template-columns: 1fr;
    }

    .wcfpi-pos-cart-card {
        position: static;
    }

    .wcfpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wcfpi-grid-2 {
        grid-template-columns: 1fr;
    }

    .wcfpi-invoice-filter-form .wcfpi-form-grid,
    .wcfpi-invoice-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .wcfpi-form,
    .wcfpi-form-grid,
    #wcfpi-pos-customer-form .wcfpi-form-grid,
    .wcfpi-pos-customer-form .wcfpi-form-grid {
        grid-template-columns: 1fr !important;
    }

    .wcfpi-list-header {
        align-items: stretch;
        flex-direction: column;
    }

    .wcfpi-list-header input {
        max-width: 100%;
    }

    .wcfpi-section-header {
        flex-direction: column;
    }

    .wcfpi-toolbar {
        flex-direction: column;
    }

    .wcfpi-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .wcfpi-button,
    a.wcfpi-button,
    button.wcfpi-button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .wcfpi-wrap {
        margin: 16px auto;
        padding: 0 10px;
    }

    .wcfpi-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

    .wcfpi-header h1 {
        font-size: 22px;
    }

    .wcfpi-card {
        padding: 16px;
        border-radius: 14px;
    }

    .wcfpi-grid {
        grid-template-columns: 1fr;
    }

    .wcfpi-pos-search {
        flex-direction: column;
    }

    .wcfpi-pos-product-card {
        grid-template-columns: 58px 1fr;
    }

    .wcfpi-pos-product-card img {
        width: 58px;
        height: 58px;
    }

    .wcfpi-pos-product-action {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: stretch;
    }

    .wcfpi-pos-customer-card,
    .wcfpi-selected-customer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .wcfpi-invoice-filter-form .wcfpi-form-grid,
    .wcfpi-invoice-filter-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .wcfpi-table {
        min-width: 900px;
    }

    .wcfpi-pos-product-results,
    .wcfpi-pos-customer-results {
        max-height: none;
    }
}

/* Mouse drag horizontal scroll */
.wcfpi-table-wrap,
.wcfpi-invoice-table-wrap {
    cursor: grab;
    user-select: none;
}

.wcfpi-table-wrap.is-dragging,
.wcfpi-invoice-table-wrap.is-dragging {
    cursor: grabbing;
}

/* Drag-to-scroll for all wide dashboard tables */
.wcfpi-table-wrap,
.wcfpi-invoice-table-wrap,
.wcfpi-orders-table-wrap,
.wcfpi-due-table-wrap,
.wcfpi-pos-cart-table-wrap,
.wcfpi-products-table-wrap,
.wcfpi-customers-table-wrap {
    cursor: grab;
    user-select: none;
}

.wcfpi-table-wrap.is-dragging,
.wcfpi-invoice-table-wrap.is-dragging,
.wcfpi-orders-table-wrap.is-dragging,
.wcfpi-due-table-wrap.is-dragging,
.wcfpi-pos-cart-table-wrap.is-dragging,
.wcfpi-products-table-wrap.is-dragging,
.wcfpi-customers-table-wrap.is-dragging {
    cursor: grabbing;
}

.wcfpi-open-pos-due-popup {
    position: relative !important;
    z-index: 999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.wcfpi-due-warning {
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* POS Due Popup Table Design */
.wcfpi-pos-due-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.wcfpi-pos-due-summary > div {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.wcfpi-pos-due-summary span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 5px;
}

.wcfpi-pos-due-summary strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    word-break: break-word;
}

.wcfpi-pos-due-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    cursor: grab;
}

.wcfpi-pos-due-table-wrap.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.wcfpi-pos-due-table {
    width: 100%;
    min-width: 1150px;
    border-collapse: collapse;
    margin: 0;
}

.wcfpi-pos-due-table th {
    background: #f9fafb;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    padding: 18px 16px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.wcfpi-pos-due-table td {
    color: #111827;
    font-size: 14px;
    padding: 18px 16px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    line-height: 1.6;
}

.wcfpi-pos-due-table tr:last-child td {
    border-bottom: 0;
}

.wcfpi-due-amount {
    color: #b91c1c;
    font-weight: 900;
}

.wcfpi-due-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.wcfpi-due-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 9px;
    border: 0;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}

.wcfpi-due-btn-print {
    background: #4f46e5;
}

.wcfpi-due-btn-print:hover {
    background: #4338ca;
}

.wcfpi-due-btn-receive {
    background: #16a34a;
}

.wcfpi-due-btn-receive:hover {
    background: #15803d;
}

@media (max-width: 900px) {
    .wcfpi-pos-due-summary {
        grid-template-columns: 1fr;
    }

    .wcfpi-pos-due-table {
        min-width: 980px;
    }
}

/* Fix Receive Payment button text cutting */
.wcfpi-pos-due-table th:last-child,
.wcfpi-pos-due-table td:last-child {
    min-width: 190px;
    width: 190px;
}

.wcfpi-due-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    min-width: 170px;
}

.wcfpi-due-btn {
    min-width: 150px;
    width: max-content;
    max-width: 100%;
    white-space: nowrap;
    overflow: visible;
    text-align: center;
}

.wcfpi-due-btn-receive {
    min-width: 155px;
}

/* =========================================================
   PROFESSIONAL POS LOGIN PAGE
========================================================= */

.wcfpi-login-page,
.wcfpi-login-page * {
    box-sizing: border-box;
}

.wcfpi-login-page {
    width: 100%;
    padding: 40px 20px;
}

.wcfpi-login-shell {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.wcfpi-login-left {
    padding: 54px 48px;
    background: linear-gradient(135deg, #111827 0%, #312e81 100%);
    color: #ffffff;
}

.wcfpi-login-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.3px;
}

.wcfpi-login-left h1 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 42px;
    line-height: 1.1;
    font-weight: 800;
}

.wcfpi-login-subtitle {
    margin: 0 0 28px;
    color: rgba(255,255,255,0.82);
    font-size: 16px;
    line-height: 1.7;
    max-width: 500px;
}

.wcfpi-login-features {
    display: grid;
    gap: 14px;
}

.wcfpi-login-feature {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
}

.wcfpi-login-feature strong {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.wcfpi-login-feature span {
    display: block;
    color: rgba(255,255,255,0.78);
    font-size: 14px;
    line-height: 1.6;
}

.wcfpi-login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
    background: #f8fafc;
}

.wcfpi-login-card {
    width: 100%;
    max-width: 420px;
    padding: 34px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.wcfpi-login-card h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
}

.wcfpi-login-card-text {
    margin: 0 0 22px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.wcfpi-login-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.wcfpi-login-form {
    margin: 0;
}

.wcfpi-login-field {
    margin-bottom: 18px;
}

.wcfpi-login-field label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.wcfpi-login-field input {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wcfpi-login-field input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.wcfpi-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
}

.wcfpi-login-submit:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.28);
}

.wcfpi-forgot-password-link {
    display: inline-block;
    margin-top: 16px;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.wcfpi-forgot-password-link:hover {
    color: #312e81;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .wcfpi-login-shell {
        grid-template-columns: 1fr;
    }

    .wcfpi-login-left,
    .wcfpi-login-right {
        padding: 28px 22px;
    }

    .wcfpi-login-card {
        max-width: 100%;
        padding: 24px 20px;
    }

    .wcfpi-login-left h1 {
        font-size: 32px;
    }
}

/* POS login: single centered card */

.wcfpi-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 620px;
    padding: 56px 20px;
    background: #f8fafc;
}

.wcfpi-login-shell-single {
    display: block !important;
    width: 100% !important;
    max-width: 470px !important;
    min-height: auto !important;
    margin: 0 auto !important;
    padding: 18px !important;
    overflow: visible !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.12) !important;
}

.wcfpi-login-shell-single .wcfpi-login-card {
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    padding: 34px 30px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.wcfpi-login-title-area {
    margin-bottom: 26px;
    text-align: center;
}

.wcfpi-login-title-area .wcfpi-login-badge {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 6px 11px;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    background: #f5f3ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 800;
}

.wcfpi-login-title-area h1 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
}

.wcfpi-login-shell-single .wcfpi-login-card h2 {
    margin: 0 0 8px;
    text-align: center;
}

.wcfpi-login-shell-single .wcfpi-login-card-text {
    margin: 0 0 26px;
    text-align: center;
}

.wcfpi-login-shell-single .wcfpi-forgot-password-link {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
}

@media (max-width: 520px) {
    .wcfpi-login-page {
        min-height: auto;
        padding: 28px 12px;
    }

    .wcfpi-login-shell-single {
        padding: 12px !important;
        border-radius: 17px !important;
    }

    .wcfpi-login-shell-single .wcfpi-login-card {
        padding: 28px 20px !important;
    }

    .wcfpi-login-title-area h1 {
        font-size: 25px;
    }
}