/* ═══════════════════════════════════════════════════════
   Rental Check-In/Out — checkin.drb.lat
   Mobile-first, premium dark design
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #0f0f13;
    --bg-card: #1a1a24;
    --bg-item: #22222f;
    --bg-item-hover: #2a2a3a;
    --text: #e8e8f0;
    --text-muted: #8888a0;
    --accent-green: #22c55e;
    --accent-green-glow: rgba(34, 197, 94, 0.25);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.25);
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --border: #2a2a3a;
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Views ─── */
.view {
    display: none;
    max-width: 540px;
    margin: 0 auto;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}
.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Loading ─── */
.loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Page Header ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.doc-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkout-badge {
    background: var(--accent-green-glow);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.checkin-badge {
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

/* ─── Rental Info ─── */
.rental-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.info-row + .info-row {
    border-top: 1px solid var(--border);
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
}

/* ─── Section Title ─── */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-all-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.toggle-all-btn:hover {
    background: var(--bg-item);
    color: var(--text);
}

/* ─── Items List ─── */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-item);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.item-card:hover {
    background: var(--bg-item-hover);
    border-color: #3a3a4a;
}

.item-card.selected {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.08);
}

.item-card.selected.checkin-mode {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.item-card.skipped {
    opacity: 0.4;
    border-color: var(--border);
    background: var(--bg-item);
}

.item-checkbox {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.item-card.selected .item-checkbox {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.item-card.selected.checkin-mode .item-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.item-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.item-img-placeholder {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-desc {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
}

.item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.item-qty {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 30px;
    text-align: center;
}

/* ─── Notes ─── */
.notes-section {
    margin-bottom: 20px;
}

.notes-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.notes-section textarea {
    width: 100%;
    background: var(--bg-item);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.notes-section textarea:focus {
    border-color: var(--accent-blue);
}

/* ─── Big Action Button ─── */
.big-action-btn {
    width: 100%;
    border: none;
    border-radius: var(--radius);
    padding: 18px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 40px;
}

.big-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-btn {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-green-glow);
}

.checkout-btn:hover:not(:disabled) {
    background: #1db954;
    box-shadow: 0 6px 28px var(--accent-green-glow);
    transform: translateY(-1px);
}

.checkin-btn {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-blue-glow);
}

.checkin-btn:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 6px 28px var(--accent-blue-glow);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 20px;
}

/* ─── Cards (error, thank you) ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    margin-top: 20vh;
}

.icon-big {
    font-size: 56px;
    margin-bottom: 16px;
}

.card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Thank You ─── */
.thankyou-card {
    margin-top: 15vh;
}

.ty-summary {
    margin-top: 20px;
    background: var(--bg-item);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 13px;
    text-align: left;
    line-height: 1.6;
}

.ty-timestamp {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── Responsive ─── */
@media (max-width: 400px) {
    .item-img, .item-img-placeholder {
        width: 42px;
        height: 42px;
    }
    .item-desc {
        font-size: 12px;
    }
    .page-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}
