/* =========================================================
   RENTAL SYSTEM PRO — Frontend CSS v2.0
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

.rsp-wrap {
    max-width: 860px;
    margin: 30px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #1e293b;
}

/* ── Header ─────────────────────────────────────────────── */
.rsp-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    color: #fff;
    padding: 28px 32px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 18px;
}
.rsp-logo {
    font-size: 40px;
    line-height: 1;
}
.rsp-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}
.rsp-header p {
    margin: 0;
    font-size: 13px;
    opacity: .75;
}

/* ── Body ────────────────────────────────────────────────── */
.rsp-body {
    background: #f8fafc;
    padding: 24px;
    border-radius: 0 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Card ────────────────────────────────────────────────── */
.rsp-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
    border: 1px solid #e8edf5;
    animation: rsp-fadeup .3s ease both;
}
@keyframes rsp-fadeup {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}

.rsp-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    letter-spacing: -.2px;
}

/* ── Grids ───────────────────────────────────────────────── */
.rsp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.rsp-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}
.rsp-full { grid-column: 1 / -1; }

/* ── Fields ──────────────────────────────────────────────── */
.rsp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rsp-field label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.req { color: #ef4444; }

.rsp-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    font-family: inherit;
}
.rsp-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.rsp-input[readonly] {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}
.rsp-input::placeholder { color: #94a3b8; }

.rsp-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

/* ── Upload Area ─────────────────────────────────────────── */
.rsp-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    color: #64748b;
    font-size: 13px;
}
.rsp-upload-area:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}
.rsp-file-name {
    font-size: 12px;
    color: #16a34a;
    margin-top: 5px;
    font-weight: 500;
}

/* ── Buttons ─────────────────────────────────────────────── */
.rsp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, opacity .2s;
}
.rsp-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.rsp-btn:active { transform: translateY(0); }

.rsp-btn-add {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    margin-top: 4px;
}
.rsp-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    padding: 15px;
    font-size: 16px;
    margin-top: 14px;
    border-radius: 12px;
}
.rsp-btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.rsp-btn-print { background: #1e293b; color: #fff; }
.rsp-btn-wa    { background: #25D366; color: #fff; }
.rsp-btn-ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    width: 100%;
    margin-top: 8px;
}

/* ── Table Items ─────────────────────────────────────────── */
.rsp-table-wrap { overflow-x: auto; }
.rsp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.rsp-table th {
    background: #f8fafc;
    padding: 9px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #64748b;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
}
.rsp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.rsp-table tr:last-child td { border-bottom: none; }
.rsp-table .del-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rsp-table .del-btn:hover { background: #ef4444; color: #fff; }

/* ── Total Row ───────────────────────────────────────────── */
.rsp-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #1e40af);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
}
.rsp-total-amount {
    font-size: 22px;
    font-weight: 800;
}

/* ── ToS ─────────────────────────────────────────────────── */
.rsp-tos {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin: 14px 0 0;
}
.rsp-tos a { color: #2563eb; }

/* ── Modal ───────────────────────────────────────────────── */
.rsp-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
    animation: rsp-fadein .2s ease;
}
@keyframes rsp-fadein { from{opacity:0} to{opacity:1} }

.rsp-modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: rsp-slideup .3s cubic-bezier(.22,1,.36,1);
}
@keyframes rsp-slideup { from{transform:translateY(30px);opacity:0} to{transform:none;opacity:1} }

.rsp-modal-icon { font-size: 52px; margin-bottom: 12px; }
.rsp-modal-box h3 { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: #1e293b; }
.rsp-modal-box p  { color: #64748b; font-size: 14px; margin: 4px 0; }
.rsp-modal-actions {
    display: flex;
    gap: 10px;
    margin: 22px 0 0;
}
.rsp-modal-actions .rsp-btn { flex: 1; }

/* ── Loading spinner ─────────────────────────────────────── */
.rsp-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rsp-spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes rsp-spin { to{transform:rotate(360deg)} }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .rsp-grid-2, .rsp-grid-3 { grid-template-columns: 1fr; }
    .rsp-full { grid-column: 1; }
    .rsp-header { padding: 20px; }
    .rsp-body   { padding: 14px; }
    .rsp-card   { padding: 16px; }
    .rsp-modal-actions { flex-direction: column; }
}

/* ── PRINT STYLES ────────────────────────────────────────── */
@media print {
    .rsp-no-print { display: none !important; }
}

/* ── Payment Methods ─────────────────────────────────────── */
.rsp-pay-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rsp-pay-option {
    cursor: pointer;
    display: block;
}
.rsp-pay-option input[type="radio"] {
    display: none;
}
.rsp-pay-opt-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color .2s, background .2s, box-shadow .2s;
    background: #fff;
}
.rsp-pay-option:hover .rsp-pay-opt-inner {
    border-color: #93c5fd;
    background: #f0f9ff;
}
.rsp-pay-option input:checked ~ .rsp-pay-opt-inner {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.rsp-pay-opt-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.rsp-pay-opt-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rsp-pay-opt-info strong {
    font-size: 14px;
    font-weight: 700;
}
.rsp-pay-opt-detail {
    font-size: 12px;
    color: #64748b;
}
.rsp-pay-opt-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: transparent;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.rsp-pay-option input:checked ~ .rsp-pay-opt-inner .rsp-pay-opt-check {
    background: #3b82f6;
    color: #fff;
}

/* QR Code display */
.rsp-pay-qr {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin-top: 6px;
    animation: rsp-fadeup .3s ease;
}
.rsp-pay-qr img {
    max-width: 180px;
    max-height: 180px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.rsp-pay-qr p {
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 0;
}

/* Selected payment info banner */
.rsp-pay-selected-info {
    margin-top: 12px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 8px;
}
