/* public/css/clients_modern.css */

:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(12px);
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent-glow: rgba(236, 72, 153, 0.15);
}

/* --- STAT CARDS (GLASSMORPHISM) --- */
.cli-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.cli-stats-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cli-stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.cli-stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.cli-stats-card:hover::before {
    opacity: 1;
}

.cli-card-text {
    position: relative;
    z-index: 1;
}

.cli-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 8px;
}

.cli-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.cli-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.cli-stats-card:hover .cli-icon-circle {
    transform: scale(1.1) rotate(5deg);
}

/* Specific Card Colors */
.card-total .cli-icon-circle { background: #eef2ff; color: #4f46e5; }
.card-debt .cli-icon-circle { background: #fff1f2; color: #e11d48; }
.card-active .cli-icon-circle { background: #f0fdf4; color: #16a34a; }
.card-limit .cli-icon-circle { background: #fff7ed; color: #ea580c; }

/* --- TABLE MODERNIZATION --- */
.clients-container {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-wrapper input:focus {
    background: white;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

#clients-main-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

#clients-main-table th {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px;
}

.client-row {
    background: white;
    transition: all 0.2s;
}

.client-row:hover {
    background: #f8fafc;
    transform: scale(1.005);
}

.client-row td {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.client-row td:first-child { border-left: 1px solid #f1f5f9; border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.client-row td:last-child { border-right: 1px solid #f1f5f9; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.cli-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.badge-pill {
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 8px;
}

.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark Mode Overrides (if index.html supports it) */
[data-theme="dark"] .clients-container { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .client-row { background: #1e293b; color: #f8fafc; }
[data-theme="dark"] .client-row:hover { background: #334155; }
[data-theme="dark"] .cli-stats-card { background: rgba(30, 41, 59, 0.7); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .cli-value { color: #f8fafc; }
[data-theme="dark"] .search-wrapper input { background: #0f172a; border-color: #334155; color: white; }

/* --- QUICK VIEW MODAL --- */
.quick-view-modal { text-align: left; }
.qv-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.qv-avatar { width: 70px; height: 70px; font-size: 1.8rem; border-radius: 20px; }
.qv-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 25px; }
.qv-field { display: flex; flex-direction: column; gap: 4px; }
.qv-field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; font-weight: 700; }
.qv-field-value { font-size: 0.95rem; color: #1e293b; font-weight: 600; }
.qv-metrics { display: flex; gap: 15px; margin-bottom: 25px; }
.qv-metric-card { flex: 1; padding: 15px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid transparent; }
.qv-metric-debt { background: #fef2f2; color: #e11d48; border-color: #fee2e2; }
.qv-metric-balance { background: #f0fdf4; color: #16a34a; border-color: #dcfce7; }
.qv-metric-label { font-size: 0.65rem; text-transform: uppercase; font-weight: 800; margin-bottom: 5px; opacity: 0.8; }
.qv-metric-value { font-size: 1.2rem; font-weight: 800; }
.qv-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qv-action-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; border: none; cursor: pointer; }
.qv-btn-pay { background: #6366f1; color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.qv-btn-pay:hover { background: #4f46e5; transform: translateY(-2px); }
.qv-btn-edit { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.qv-btn-edit:hover { background: #f1f5f9; color: #1e293b; }
.qv-btn-print { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.qv-btn-print:hover { background: #f1f5f9; color: #1e293b; }
.qv-btn-history { grid-column: span 2; background: #1e293b; color: white; margin-top: 5px; }
.qv-btn-history:hover { background: #0f172a; }
