/* DefPay — customer account & shared front components */

.defpay-account {
    --defpay-navy: #0f2744;
    --defpay-navy-soft: #1e3a5f;
    --defpay-slate: #64748b;
    --defpay-border: #e2e8f0;
    --defpay-bg: #f8fafc;
    --defpay-success: #059669;
    --defpay-warning: #d97706;
    --defpay-danger: #dc2626;
    --defpay-radius: 14px;
    --defpay-shadow: 0 4px 24px rgba(15, 39, 68, 0.08);

    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--defpay-border);
    border-radius: var(--defpay-radius);
    box-shadow: var(--defpay-shadow);
    font-family: inherit;
}

.defpay-account-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--defpay-border);
}

.defpay-account-header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--defpay-navy) 0%, var(--defpay-navy-soft) 100%);
    color: #fff;
}

.defpay-account-header-icon svg {
    width: 22px;
    height: 22px;
}

.defpay-account-title {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--defpay-navy);
    letter-spacing: -0.02em;
}

.defpay-account-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--defpay-slate);
}

.defpay-account-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.defpay-kpi-card {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: var(--defpay-bg);
    border: 1px solid var(--defpay-border);
}

.defpay-kpi-card--accent {
    background: linear-gradient(180deg, #fff 0%, #f0f7ff 100%);
    border-color: #bfdbfe;
}

.defpay-kpi-card--success {
    background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%);
    border-color: #a7f3d0;
}

.defpay-kpi-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--defpay-slate);
    margin-bottom: 0.35rem;
}

.defpay-kpi-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--defpay-navy);
    line-height: 1.2;
}

.defpay-kpi-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--defpay-slate);
}

.defpay-utilization {
    margin-bottom: 1.25rem;
}

.defpay-utilization-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--defpay-slate);
}

.defpay-utilization-head strong {
    color: var(--defpay-navy);
    font-size: 0.9375rem;
}

.defpay-utilization-track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.defpay-utilization-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    transition: width 0.4s ease;
}

.defpay-utilization-fill--warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.defpay-utilization-fill--critical {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.defpay-alert {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.defpay-alert--warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.defpay-statement-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 100%);
    color: #fff;
}

.defpay-statement-card-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 220px;
}

.defpay-statement-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}

.defpay-statement-card-icon svg {
    width: 22px;
    height: 22px;
}

.defpay-statement-card-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.defpay-statement-card-desc {
    margin: 0;
    font-size: 0.8125rem;
    opacity: 0.88;
    line-height: 1.45;
    max-width: 36rem;
}

.defpay-statement-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.defpay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    line-height: 1.2;
}

.defpay-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.defpay-btn-primary {
    background: #fff;
    color: var(--defpay-navy);
    border-color: #fff;
}

.defpay-btn-primary:hover {
    background: #f1f5f9;
    color: var(--defpay-navy);
}

.defpay-btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.defpay-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.defpay-orders-section {
    margin-top: 0.25rem;
}

.defpay-orders-title {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--defpay-slate);
}

.defpay-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.defpay-order-item {
    padding: 0.875rem 1rem;
    border: 1px solid var(--defpay-border);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.defpay-order-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 39, 68, 0.06);
}

.defpay-order-item--overdue {
    border-color: #fecaca;
    background: #fffbfb;
}

.defpay-order-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.defpay-order-ref {
    font-weight: 700;
    color: var(--defpay-navy);
    text-decoration: none;
}

.defpay-order-ref:hover {
    text-decoration: underline;
}

.defpay-order-amount {
    font-weight: 600;
    color: var(--defpay-navy);
    white-space: nowrap;
}

.defpay-order-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.defpay-order-due {
    color: var(--defpay-slate);
}

.defpay-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.defpay-badge--paid {
    background: #d1fae5;
    color: #065f46;
}

.defpay-badge--open {
    background: #dbeafe;
    color: #1e40af;
}

.defpay-badge--overdue {
    background: #fee2e2;
    color: #991b1b;
}

.defpay-badge--muted {
    background: #f1f5f9;
    color: #64748b;
}

.defpay-empty {
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: var(--defpay-slate);
    font-size: 0.875rem;
    background: var(--defpay-bg);
    border-radius: 10px;
}

.defpay-payment-info .payment_module {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .defpay-account-kpis {
        grid-template-columns: 1fr;
    }

    .defpay-statement-card {
        flex-direction: column;
        align-items: stretch;
    }

    .defpay-statement-card-actions {
        width: 100%;
    }

    .defpay-statement-card-actions .defpay-btn {
        flex: 1;
    }
}
