
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --accent: #f59e0b;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.05) 0, transparent 50%);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for mobile nav */
}

/* Glass Effect */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(to left, var(--primary), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }
.stat-label { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 5px; }
.stat-num { font-size: 1.3rem; font-weight: 700; }

/* Control Bar */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 15px;
    color: white;
    outline: none;
}

/* Customer List */
.customer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-card:hover { background: rgba(255,255,255,0.05); }

.cust-info h3 { font-size: 1rem; margin-bottom: 4px; }
.cust-info p { font-size: 0.75rem; color: var(--text-muted); }

.cust-debt { text-align: left; }
.debt-amt { font-weight: 700; color: var(--danger); font-size: 1.1rem; }
.debt-status { font-size: 0.65rem; padding: 4px 8px; border-radius: 8px; margin-top: 4px; display: inline-block; }

/* Status Badges */
.bg-paid { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.bg-pending { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.bg-partial { background: rgba(245, 158, 11, 0.15); color: var(--accent); }

/* FAB / Buttons */
.fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 100;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary { background: var(--primary); color: white; width: 100%; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: #1e293b;
    border-radius: 30px 30px 0 0;
    padding: 30px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Inputs */
.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-muted); }
.input-group input, .input-group textarea {
    width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg); color: white; outline: none;
}

/* Toast */
#toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: 50px; background: var(--primary);
    color: white; font-weight: 600; font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    z-index: 2000; transition: 0.3s; opacity: 0; visibility: hidden;
}
#toast.show { opacity: 1; visibility: visible; }

/* Login */
.login-screen {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 5000;
}
.login-card { width: 100%; max-width: 350px; text-align: center; }

.hidden { display: none !important; }

@media (min-width: 768px) {
    .modal-overlay { align-items: center; }
    .modal-content { border-radius: 25px; }
}
