/* PATCH-SIMPLPAY-020 */

.simplpay-network-indicator {
    position: fixed;
    top:
        max(
            10px,
            env(safe-area-inset-top)
        );
    left: 50%;
    z-index: 1200;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    color: #166534;
    background: rgba(240, 253, 244, 0.96);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-size: 11px;
    font-weight: 900;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.simplpay-network-indicator.offline {
    border-color: #fed7aa;
    color: #9a3412;
    background: rgba(255, 247, 237, 0.97);
}

.simplpay-network-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.13);
}

.simplpay-network-indicator.offline
.simplpay-network-dot {
    background: #f97316;
    box-shadow:
        0 0 0 4px rgba(249, 115, 22, 0.13);
}

.offline-draft-button {
    width: 100%;
    min-height: 52px;
    margin-top: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    color: #334155;
    background:
        linear-gradient(
            145deg,
            #f8fafc,
            #f1f5f9
        );
    font-size: 13px;
    font-weight: 900;
}

.offline-draft-button:hover {
    border-color: #94a3b8;
    box-shadow:
        0 10px 23px rgba(51, 65, 85, 0.1);
    transform: translateY(-1px);
}

.offline-drafts-summary {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 15px;
}

.offline-draft-stat {
    min-width: 0;
    padding: 11px 7px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
}

.offline-draft-stat-value {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: 17px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offline-draft-stat-label {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.offline-drafts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    margin-bottom: 13px;
}

.offline-drafts-status {
    margin: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.45;
}

.offline-drafts-clear {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #fecaca;
    border-radius: 11px;
    cursor: pointer;
    color: #b91c1c;
    background: #fff7f7;
    font-size: 10px;
    font-weight: 900;
}

.offline-drafts-list {
    display: grid;
    gap: 10px;
    max-height: min(56vh, 520px);
    overflow-y: auto;
    padding-right: 2px;
}

.offline-draft-card {
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );
}

.offline-draft-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.offline-draft-type {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.offline-draft-type.collect {
    color: #9a3412;
    background: #ffedd5;
}

.offline-draft-amount {
    color: #111827;
    font-size: 16px;
    font-weight: 950;
    white-space: nowrap;
}

.offline-draft-title {
    margin: 10px 0 0;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
}

.offline-draft-detail {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.offline-draft-time {
    margin: 7px 0 0;
    color: #94a3b8;
    font-size: 9px;
}

.offline-draft-actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.offline-draft-action {
    min-height: 42px;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    color: #334155;
    background: #f8fafc;
    font-size: 10px;
    font-weight: 900;
}

.offline-draft-action.primary {
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #334155,
            #2563eb
        );
}

.offline-draft-action.danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff7f7;
}

.offline-drafts-empty {
    padding: 24px 15px;
    border: 1px dashed #cbd5e1;
    border-radius: 17px;
    color: #64748b;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1.65;
    text-align: center;
}

.offline-drafts-warning {
    margin: 13px 0 0;
    padding: 11px 12px;
    border: 1px solid #fde68a;
    border-radius: 13px;
    color: #92400e;
    background: #fffbeb;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.55;
    text-align: center;
}

.offline-drafts-more-card {
    position: relative;
}

.offline-drafts-more-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    display: none;
    place-items: center;
    color: #ffffff;
    background: #dc2626;
    font-size: 8px;
    font-weight: 950;
}

@media (max-width: 430px) {
    .simplpay-network-indicator {
        top:
            max(
                7px,
                env(safe-area-inset-top)
            );
    }

    .offline-drafts-summary,
    .offline-draft-actions {
        grid-template-columns: 1fr;
    }

    .offline-drafts-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}
