/* =============================================
   Payment Tracker - Custom styles (Tailwind + utilities)
   ============================================= */

* { -webkit-tap-highlight-color: transparent; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overscroll-behavior-y: none;
}

/* ---------- Inputs ---------- */
.pt-input {
    height: 3rem;
    padding: 0 1rem;
    border-radius: 0.875rem;
    font-size: 0.95rem;
    color: #1f2937;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    transition: border-color .15s, box-shadow .15s, background .15s;
    outline: none;
}
.dark .pt-input {
    color: #e5e7eb;
    background: #1f2937;
    border-color: #374151;
}
.pt-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    background: #fff;
}
.dark .pt-input:focus { background: #111827; }

.pt-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: .4rem;
}
.dark .pt-label { color: #9ca3af; }

/* ---------- Cards ---------- */
.pt-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
    border: 1px solid #f1f3f5;
}
.dark .pt-card {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.stat-card {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 1.1rem;
    padding: .9rem .85rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,235,.25);
    min-height: 92px;
}
.stat-value { font-size: 1.05rem; font-weight: 800; line-height: 1.3; margin-top: .35rem; word-break: break-word; }
.stat-label { font-size: .68rem; opacity: .85; font-weight: 600; }

/* Cards given distinct pastel gradients */
#stats-cards .stat-card:nth-child(1) { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
#stats-cards .stat-card:nth-child(2) { background: linear-gradient(135deg,#6366f1,#4338ca); }
#stats-cards .stat-card:nth-child(3) { background: linear-gradient(135deg,#10b981,#047857); }
#stats-cards .stat-card:nth-child(4) { background: linear-gradient(135deg,#f97316,#c2410c); }
#stats-cards .stat-card:nth-child(5) { background: linear-gradient(135deg,#22c55e,#0d9488); }
#stats-cards .stat-card:nth-child(6) { background: linear-gradient(135deg,#f43f5e,#be123c); }

/* ---------- Client cards ---------- */
.client-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1rem;
    border: 1px solid #f1f3f5;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
.dark .client-card {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.mini-stat { background: #f9fafb; border-radius: .8rem; padding: .55rem .5rem; text-align: center; }
.dark .mini-stat { background: #111827; }
.mini-label { font-size: .62rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; }
.mini-val { font-size: .88rem; font-weight: 800; margin-top: .15rem; }

/* ---------- Status badges ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .66rem;
    font-weight: 700;
    padding: .3rem .6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.status-clear { color: #047857; background: #d1fae5; }
.status-pending { color: #c2410c; background: #ffedd5; }
.dark .status-clear { color: #6ee7b7; background: rgba(16,185,129,.15); }
.dark .status-pending { color: #fdba74; background: rgba(249,115,22,.15); }

/* ---------- Chips ---------- */
.chip {
    padding: .55rem 1.1rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: #6b7280;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    white-space: nowrap;
    transition: all .15s;
}
.dark .chip { color: #d1d5db; background: #1f2937; border-color: #374151; }
.chip-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.dark .chip-active { color: #fff; }

/* ---------- Action buttons ---------- */
.action-btn {
    height: 2.7rem;
    border-radius: .85rem;
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    transition: transform .12s, filter .12s;
}
.action-btn:active { transform: scale(.96); }
.action-primary { background: #2563eb; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.25); }
.action-primary:hover { filter: brightness(1.08); }
.action-secondary {
    background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe;
}
.dark .action-secondary { background: rgba(37,99,235,.15); color: #93c5fd; border-color: rgba(37,99,235,.3); }

.act-btn {
    height: 2.7rem;
    border-radius: .85rem;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: transform .12s;
}
.dark .act-btn { color: #e5e7eb; background: #111827; border-color: #374151; }
.act-btn:active { transform: scale(.96); }

/* ---------- Pagination ---------- */
.pg-btn {
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 .7rem;
    border-radius: .75rem;
    font-size: .8rem;
    font-weight: 700;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: all .15s;
}
.dark .pg-btn { color: #d1d5db; background: #1f2937; border-color: #374151; }
.pg-btn:active { transform: scale(.95); }
.pg-active { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 3px 10px rgba(37,99,235,.3); }
.pg-active:active { background: #2563eb; color: #fff; }

/* ---------- Modals ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(17, 24, 39, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
@media (min-width: 640px) {
    .modal { align-items: center; }
}
.modal-box {
    width: 100%;
    background: #fff;
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1.4rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .22s cubic-bezier(.2,.8,.3,1);
    max-height: 92vh;
    overflow-y: auto;
}
@media (min-width: 640px) {
    .modal-box { border-radius: 1.5rem; margin: 0 1rem; max-width: 28rem; transform: scale(.94); opacity: 0; transition: transform .2s, opacity .2s; }
}
.modal-show .modal-box { transform: translateY(0) scale(1); opacity: 1; }
.dark .modal-box { background: #1f2937; }

/* ---------- Payment mode buttons ---------- */
.pay-mode-btn {
    padding: .6rem 0;
    border-radius: .85rem;
    font-size: .72rem;
    font-weight: 700;
    color: #6b7280;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    transition: all .15s;
}
.dark .pay-mode-btn { color: #d1d5db; background: #111827; border-color: #374151; }
.pay-mode-active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.dark .pay-mode-active { background: rgba(37,99,235,.2); color: #93c5fd; }

/* ---------- History items ---------- */
.hist-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: #f9fafb;
    border-radius: .9rem;
    padding: .7rem .8rem;
    border: 1px solid #f1f3f5;
}
.dark .hist-item { background: #111827; border-color: #374151; }

/* ---------- Activity items ---------- */
.activity-item {
    display: flex;
    gap: .75rem;
    background: #fff;
    border: 1px solid #f1f3f5;
    border-radius: 1.1rem;
    padding: .85rem .9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dark .activity-item { background: #1f2937; border-color: #374151; }

/* ---------- Skeleton loading ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 1rem;
}
.dark .skeleton { background: #374151; }
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    animation: shimmer 1.3s infinite;
}
.dark .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Toast ---------- */
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-toast { animation: toastIn .25s ease; }

/* ---------- Hide scrollbars ---------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Scrollbar (activity list) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
.dark ::-webkit-scrollbar-thumb { background: #4b5563; }
