/* ========================================
   Invoice Results - Modern Cards v2
   ======================================== */

/* Processing overlay */
.processing-animation-pay {
    position: fixed;
    top: 50%;
    left: 50%;
    width: auto !important;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 28px 36px;
    border-radius: 16px;
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    z-index: 2000;
}
.loader {
    border: 3px solid var(--border, #e2e8f0);
    border-top-color: var(--primary, #1a6b1f);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== INVOICE CARDS v2 ========== */
.container-cards {
    border-radius: 20px !important;
    width: 100%;
    max-width: 380px;
    background: #fff !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    position: relative;
}
.container-cards::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #1a6b1f), var(--accent, #d4a017));
}
.container-cards:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.04);
    transform: translateY(-4px);
}
.container-cards .card-body {
    padding: 28px 24px 24px !important;
    text-align: left;
}

/* Invoice reference */
.invoice-ref {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    background: var(--bg-alt, #f0fdf4);
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary, #1a6b1f);
    letter-spacing: .03em;
    margin-bottom: 16px;
}
.invoice-ref i {
    font-size: .65rem;
}

/* Amount display */
.invoice-amount {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--text, #1a1a2e);
    line-height: 1;
    margin: 8px 0 16px;
    letter-spacing: -.02em;
}
.invoice-amount-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Due date */
.invoice-due {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    margin-bottom: 20px;
}
.invoice-due-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-alt, #f0fdf4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.invoice-due-icon i {
    font-size: .85rem;
    color: var(--primary, #1a6b1f);
}
.invoice-due-icon.overdue {
    background: #fef2f2;
}
.invoice-due-icon.overdue i {
    color: #ef4444;
}
.invoice-due-text {
    flex: 1;
}
.invoice-due-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
}
.invoice-due-date {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text, #1a1a2e);
}
.invoice-due-date.text-danger {
    color: #ef4444 !important;
}

/* Value label */
.value-pay {
    display: none;
}

/* Pay button */
.pay_btn {
    background: linear-gradient(135deg, var(--primary, #1a6b1f), var(--green-600, #16a34a)) !important;
    width: 100%;
    padding: 14px 28px;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700;
    font-size: .95rem;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 14px rgba(26,107,31,.25);
    letter-spacing: -.01em;
}
.pay_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,107,31,.35);
}
.pay_btn:active {
    transform: translateY(0);
}

/* Pay total button */
.pay_btn_total {
    background: linear-gradient(135deg, var(--accent, #d4a017), var(--gold-600, #b8860b)) !important;
    width: auto;
    min-width: 220px;
    padding: 14px 32px;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700;
    font-size: .95rem;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 14px rgba(212,160,23,.25);
}
.pay_btn_total:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212,160,23,.35);
}

.text-pay-total {
    margin-bottom: 0 !important;
    font-size: .95rem;
    font-weight: 700;
}

/* Overdue badge */
.btn-overdue-invoice {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 2px 8px rgba(239,68,68,.25);
    text-transform: uppercase;
}

/* Download invoice button */
.btn-download-invoice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: var(--primary, #1a6b1f);
    border: 2px solid var(--green-200, #bbf7d0);
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
    transition: all .25s;
    width: 100%;
    justify-content: center;
}
.btn-download-invoice:hover {
    background: var(--green-50, #f0fdf4);
    border-color: var(--primary, #1a6b1f);
    color: var(--primary, #1a6b1f);
}

/* Divider */
hr {
    border: none !important;
    height: 1px;
    background: var(--border, #e2e8f0);
    margin: 24px 0;
}

/* Fixed bottom total bar */
.fixed-right {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    padding: 16px 28px;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    text-align: center;
}
#pay_total { display: none; }

/* Overlay */
#overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #fff;
}

/* Report/greeting */
.report-invoice {
    border-radius: 16px !important;
    padding: 20px 28px !important;
    background: #fff !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    text-align: left;
}
.text-report-invoice {
    margin-bottom: 0;
    padding: 4px;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
}

/* ========== SERVICE STATUS v2 ========== */
.service-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    white-space: nowrap;
}
.status-chip-label {
    color: var(--text-sub, #4a5568);
}
.status-chip i {
    font-size: .75rem;
}

.btn-service, .btn-service-active, .btn-service-ready, .btn-service-inactive,
.btn-service-suspended, .btn-service-prepared, .btn-device-active, .btn-device-desactive {
    border: none;
    color: var(--text, #1a1a2e);
    background: var(--bg-alt, #f0fdf4);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    margin: 4px;
    display: inline-block;
    transition: all .2s;
}
.btn-service {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-sub, #4a5568);
}
.btn-service-active {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #86efac;
}
.btn-service-inactive {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b !important;
    border: 1px solid #fecaca;
}
.btn-service-suspended {
    background: linear-gradient(135deg, #fefce8, #fef08a);
    color: #854d0e;
    border: 1px solid #fef08a;
}
.btn-service-ready {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}
.btn-service-prepared {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    color: #713f12;
    border: 1px solid #fef9c3;
}
.btn-device-active {
    background: #fff;
    border: 2px solid #22c55e;
    color: #166534;
}
.btn-device-desactive {
    background: #fff;
    border: 2px solid var(--border, #e2e8f0);
    color: var(--text-muted, #94a3b8);
}
.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: dotPulse 2s infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

@media (max-width: 768px) {
    .btn-service, .btn-service-active, .btn-service-ready, .btn-service-inactive,
    .btn-service-suspended, .btn-service-prepared, .btn-device-active, .btn-device-desactive {
        width: 100%;
        max-width: 100%;
    }
}

/* Multi-payment switch */
.form-check-input-multi-payment {
    width: 2.8em !important;
    height: 1.4em !important;
    border: 2px solid var(--border, #e2e8f0) !important;
    cursor: pointer;
}
.form-check-input:checked {
    background-color: var(--primary, #1a6b1f) !important;
    border-color: var(--primary, #1a6b1f) !important;
}
.card-title-spacer-y {
    --bs-card-title-spacer-y: 0rem;
}

p { margin-bottom: 8px !important; }

/* Pay button wrapper */
.payButtonWrapper { width: 100%; display: block; }
.payButtonWrapper .btn { visibility: visible; }
.payButtonWrapper.hidden .btn { visibility: hidden; }
.card-text-date { width: 100%; display: inline-block; }

/* Map modal */
.map-modal-content { padding: 10px; text-align: center; }
.map-modal-content h4 { margin-bottom: 10px; font-size: 1.2rem; font-weight: 700; }
.map-modal-content .details-item { display: block; text-align: left; margin-bottom: 6px; font-size: .92rem; }
.map-modal-content .map-container { height: 200px; width: 100%; border-radius: 12px; overflow: hidden; }
#mapModal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }
.modal-footer .centered-button { display: block; margin: 0 auto; }
