@font-face {
    font-family: 'Vazir';
    src: url('assets/fonts/Vazirmatn-Light.ttf') format('truetype');
}

:root {
    --navy: #0f172a;        /* سرمه‌ای تیره حرفه‌ای */
    --sky: #0ea5e9;         /* آبی آسمانی روشن برای دکمه‌ها */
    --light-bg: #f8fafc;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

body { 
    font-family: 'Vazir', Tahoma, sans-serif; 
    background-color: var(--light-bg); 
    direction: rtl; margin: 0; color: #1e293b;
    font-size: 14px; font-feature-settings: "ss01";
    -webkit-font-smoothing: antialiased;
}

/* هدر لوکس */
nav { 
    background: var(--navy); color: white; padding: 0 20px; 
    display: flex; justify-content: space-between; align-items: center; 
    position: sticky; top: 0; z-index: 100; height: 60px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.container { max-width: 1000px; margin: 0 auto; padding: 15px; }

/* کارت‌ها */
.card { 
    background: white; border-radius: 18px; padding: 20px; 
    border: 1px solid rgba(226, 232, 240, 0.8); 
    box-shadow: var(--card-shadow); margin-bottom: 20px;
    transition: transform 0.2s ease;
}

/* باکس جستجو (سرور ساید) */
.search-wrapper { position: relative; margin-bottom: 20px; display: flex; align-items: center; }

.search-btn { 
    position: absolute; right: 15px; background: none; border: none; 
    font-size: 16px; cursor: pointer; color: #94a3b8; 
}

.search-box { 
    width: 100%; 
    padding: 14px 50px; /* فاصله امن 50 پیکسلی از چپ و راست برای جلوگیری از تداخل با آیکون‌ها */
    border-radius: 25px; 
    border: 2px solid #e2e8f0; 
    font-family: 'Vazir', Tahoma, sans-serif; 
    font-size: 13px;
    background: white; 
    box-sizing: border-box; 
    margin: 0 !important;
    transition: all 0.3s ease;
    text-align: center; /* وسط‌چین کردن متن تایپ شده */
}

/* وسط‌چین کردن متن راهنمای کم‌رنگ (Placeholder) */
.search-box::placeholder {
    text-align: center;
    color: #94a3b8;
}

.search-box:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }

.clear-search {
    position: absolute; left: 15px; font-size: 11px; color: #ef4444;
    text-decoration: none; background: #fee2e2; padding: 4px 8px; border-radius: 8px;
    transition: 0.2s;
}
.clear-search:hover { background: #fecaca; }

/* دکمه‌ها */
.btn { 
    cursor: pointer; border: none; border-radius: 12px; font-family: 'Vazir'; 
    font-weight: bold; text-decoration: none; display: inline-block; 
    text-align: center; padding: 10px 20px; transition: 0.3s;
}
.btn-primary { background: var(--sky); color: white; }
.btn-primary:hover { background: #0284c7; transform: translateY(-2px); }

/* لبه‌های گرادینت بدهی */
.debt-border { border-right: 6px solid; border-image: linear-gradient(to bottom, #ef4444, #fb7185) 1 100%; }
.paid-border { border-right: 6px solid; border-image: linear-gradient(to bottom, #10b981, #34d399) 1 100%; }

/* دکمه شناور موبایل */
.fab {
    display: none; position: fixed; bottom: 25px; left: 25px; 
    width: 60px; height: 60px; background: var(--sky); 
    color: white; border-radius: 50%; justify-content: center; 
    align-items: center; font-size: 30px; box-shadow: 0 10px 20px rgba(14, 165, 233, 0.4);
    text-decoration: none; z-index: 1000; transition: 0.3s;
}
.fab:active { transform: scale(0.9); }

@media (max-width: 600px) {
    .fab { display: flex; } 
    .nav-add-btn { display: none; } 
}

/* =========================================
   استایل‌های فرم‌ها (برطرف کننده مشکل موبایل)
========================================= */
input[type="text"], 
input[type="number"], 
input[type="password"], 
input[type="date"], 
select, 
textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 5px 0 15px 0;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background-color: #f8fafc;
    font-family: 'Vazir', Tahoma, sans-serif;
    font-size: 14px;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--sky);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    background-color: #ffffff;
}

textarea { resize: vertical; min-height: 80px; }

/* گریدها و گروه‌بندی فرم‌ها */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: bold; color: #475569; margin-bottom: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0; }
}

/* =========================================
   استایل‌های صفحه‌بندی (Pagination مدرن و لوکس)
========================================= */
.pagination {
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 8px; 
    margin-top: 30px; 
    margin-bottom: 40px; 
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: white; 
    color: #64748b;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px; 
    font-weight: bold; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* سایه نرم و عمق‌دار */
    border: 1px solid transparent;
}

.page-link:hover { 
    transform: translateY(-3px); /* بالا پریدن نرم روی هاور */
    color: var(--sky);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.page-link.active {
    background: var(--sky); 
    color: white; 
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.45); /* افکت Glow آبی */
    transform: scale(1.05); /* کمی بزرگتر شدن صفحه فعلی */
    pointer-events: none; /* غیرفعال شدن کلیک روی صفحه‌ای که توش هستیم */
}