
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #f5f7fc 0%, #e9eef5 100%);
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.logo {
    font-size: 1.6rem;
    font-weight: bold;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #334155;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: 0.2s;
}

.nav-menu a:hover {
    color: #2563eb;
}

.user-greeting {
    background: #eef2ff;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-size: 0.85rem;
}

/* Responsive Navbar - موبایل */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: white;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 99;
        gap: 0;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 0.8rem;
    }

    .user-greeting {
        text-align: center;
        margin-top: 0.5rem;
    }
}

/* Cards & Forms */
.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.08);
    padding: 1.8rem;
    margin-bottom: 1.8rem;
    transition: transform 0.2s;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 28px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    border-right: 5px solid;
}

.stat-card.income { border-right-color: #10b981; }
.stat-card.cost { border-right-color: #ef4444; }
.stat-card.balance { border-right-color: #3b82f6; }

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.btn-danger {
    background: #dc2626;
}
.btn-success {
    background: #10b981;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 20px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f8fafc;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {

    table {
        border: 0;
    }

    thead {
        display: none;
    }

    table, tbody, tr, td {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 0.5rem;
        background: white;
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 0.6rem;
        border-bottom: 1px solid #eee;
        text-align: right;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #555;
    }
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
/* ========== فرم‌های مدرن ========== */
.form-card {
    background: white;
    border-radius: 32px;
    padding: 2rem 2rem 2.5rem;
    box-shadow: 0 25px 45px -12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 550px;
    margin: 2rem auto;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(2px);
}
.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 55px -12px rgba(0,0,0,0.25);
}
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-size: 0.9rem;
}
.form-group label i {
    margin-left: 0.5rem;
    color: #2563eb;
}
.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f8fafc;
}
.form-control:focus {
    border-color: #2563eb;
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 40px;
    font-weight: bold;
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    transform: scale(0.98);
    box-shadow: 0 10px 20px -5px rgba(37,99,235,0.4);
}
.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
}
.btn-secondary:hover {
    background: #e2e8f0;
}
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    font-size: 0.9rem;
}
.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: block;
}
/* radio/select هماهنگ */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: left 1rem center;
}

/* حذف اسپینرهای input number */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}


.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.btn {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }
}

.container {
    max-width: 1200px;
    margin: auto;
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.8rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}


    .btn-sm {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 8px;
        text-decoration: none;
        display: inline-block;
        text-align: center;
        transition: 0.2s;
        border: none;
        cursor: pointer;
        margin: 0 0.2rem;
    }
    .btn-info {
        background: #3b82f6;
        color: white;
    }
    .btn-info:hover {
        background: #2563eb;
    }
    .btn-warning {
        background: #f59e0b;
        color: white;
    }
    .btn-warning:hover {
        background: #d97706;
    }
    .btn-danger {
        background: #dc2626;
        color: white;
    }
    .btn-danger:hover {
        background: #b91c1c;
    }
    .inline-form {
        display: inline-block;
        margin: 0;
    }
    .btn-group {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }
    /* برای موبایل */
    @media (max-width: 768px) {
        .btn-group {
            flex-direction: column;
            align-items: stretch;
        }
        .btn-sm {
            width: 100%;
            text-align: center;
            margin: 0.2rem 0;
        }
        .actions-cell {
            padding: 0.5rem;
        }
    }