/* تعریف فونت‌ها */
@font-face {
    font-family: 'Aviny';
    src: url('../fonts/aviny.ttf') format('truetype');
}

@font-face {
    font-family: 'Iran';
    src: url('../fonts/iran.ttf') format('truetype');
}

@font-face {
    font-family: 'Yekan';
    src: url('../fonts/yekan.ttf') format('truetype');
}

/* استایل‌های عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Yekan', 'Iran', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* هدر و ناوبری */
header {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.logo img {
    height: 50px;
}

nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3498db;
}

/* فرم‌ها و جداول */
section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

h2, h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-family: 'Iran', 'Yekan', sans-serif;
}
Yekan
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input, select, textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button, .btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

button:hover, .btn:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
}

.btn-delete:hover {
    background: #c0392b;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.8rem;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
}

tr:hover {
    background: #f1f1f1;
}

/* استایل‌های صفحه لاگین */
.login-form {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
}

/* صفحه گزارشات */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    text-align: center;
}

/* استایل‌های صفحه مشاهده سند */
.document-view {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.document-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.info-row {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-weight: bold;
    width: 150px;
    color: #2c3e50;
}

.info-value {
    flex: 1;
    color: #555;
}

.document-items table {
    margin-top: 1.5rem;
    width: 100%;
}

.document-items th {
    background-color: #2c3e50;
    color: white;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.total {
    font-weight: bold;
    color: #27ae60;
}

.balance {
    font-weight: bold;
    color: #e74c3c;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2rem;
}

@media print {
    header, footer, .actions {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .document-view {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .info-row {
        flex-direction: column;
    }
    
    .info-label {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats {
        flex-direction: column;
    }
}

/* استایل‌های جدید برای صفحه ثبت سند */
.item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    align-items: center;
    position: relative;
}

.item-row > .form-group {
    flex: 1;
    min-width: 200px;
}

.item-actions {
    display: flex;
    gap: 10px;
    align-self: center;
    margin-top: 15px;
}

.btn-select-account {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 5px;
    width: 100%;
}

.btn-copy, .btn-remove {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.btn-copy {
    background: #2ecc71;
    color: white;
}

.btn-remove {
    background: #e74c3c;
    color: white;
}

.summary-box {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    flex-wrap: wrap;
    gap: 10px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.summary-item span:first-child {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

#total-debit, #total-credit {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

#total-diff {
    font-size: 1.2rem;
    font-weight: bold;
}

#total-diff.balanced {
    color: #27ae60;
}

#total-diff.positive {
    color: #e74c3c;
}

#total-diff.negative {
    color: #3498db;
}

/* استایل‌های مودال */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    left: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.account-levels {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.level {
    padding: 10px 15px;
    background: #eee;
    border-radius: 4px;
    cursor: pointer;
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.level.active {
    background: #3498db;
    color: white;
}

.accounts-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

.account-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.account-item:last-child {
    border-bottom: none;
}

.account-item:hover {
    background: #f1f1f1;
}

.account-item.back {
    background: #f8f9fa;
    font-weight: bold;
    color: #3498db;
}

.account-level {
    background: #eee;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.add-account-form {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* استایل‌های ریسپانسیو */
@media (max-width: 992px) {
    .item-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-actions {
        align-self: center;
        margin-top: 10px;
    }
    
    .summary-box {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .account-levels {
        flex-direction: column;
    }
}

/* استایل‌های جدید برای مودال کاربرپسند */
.modal-content {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#accounts-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#accounts-list-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.account-item:last-child {
    border-bottom: none;
}

.account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.account-code {
    font-weight: bold;
    color: #333;
}

.account-name {
    color: #666;
}

.account-buttons {
    display: flex;
    gap: 5px;
}

.account-buttons button {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-select {
    background-color: #4CAF50;
    color: white;
}

.btn-expand {
    background-color: #2196F3;
    color: white;
}

.btn-back {
    background-color: #f44336;
    color: white;
    width: 100%;
}

.no-accounts {
    text-align: center;
    padding: 20px;
    color: #666;
}

.account-actions {
    margin-top: 10px;
    text-align: center;
}

#add-new-account-btn {
    width: 100%;
    padding: 10px;
    background-color: #607d8b;
    color: white;
}

#add-account-view {
    padding: 15px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#cancel-add-account {
    background-color: #f44336;
    color: white;
}

/* استایل‌های جدید برای مودال کاربرپسند */
.modal-content {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#accounts-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#accounts-list-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.account-item:last-child {
    border-bottom: none;
}

.account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.account-code {
    font-weight: bold;
    color: #333;
}

.account-name {
    color: #666;
}

.account-buttons {
    display: flex;
    gap: 5px;
}

.account-buttons button {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-select {
    background-color: #4CAF50;
    color: white;
}

.btn-expand {
    background-color: #2196F3;
    color: white;
}

.btn-back {
    background-color: #f44336;
    color: white;
    width: 100%;
}

.no-accounts {
    text-align: center;
    padding: 20px;
    color: #666;
}

.account-actions {
    margin-top: 10px;
    text-align: center;
}

#add-new-account-btn {
    width: 100%;
    padding: 10px;
    background-color: #607d8b;
    color: white;
}

#add-account-view {
    padding: 15px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#cancel-add-account {
    background-color: #f44336;
    color: white;
}

.parent-account-group .parent-select {
    max-height: 150px;
    overflow-y: auto;
}

.accounts-management {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.account-form {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #45a049;
}

.accounts-list {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.btn-delete {
    color: #f44336;
    text-decoration: none;
}

.btn-delete:hover {
    text-decoration: underline;
}

.parent-group select {
    max-height: 200px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .account-form {
        padding: 15px;
    }
    
    table th, table td {
        padding: 8px;
    }
}

/* استایل‌های جدید برای صفحه مدیریت سرفصل‌ها */
.account-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.account-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.btn-refresh-accounts {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
}

.btn-refresh-accounts:hover {
    color: #2c7be5;
}

.accounts-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.accounts-list th, 
.accounts-list td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.accounts-list th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.accounts-list tr:hover {
    background-color: #f8f9fa;
}

.account-level-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.level-کل {
    background-color: #d4edda;
    color: #155724;
}

.level-معین {
    background-color: #cce5ff;
    color: #004085;
}

.level-تفصیلی {
    background-color: #fff3cd;
    color: #856404;
}

.btn-action {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 3px;
    font-size: 1.1em;
}

.btn-delete {
    color: #dc3545;
}

.btn-delete:hover {
    background-color: #f8d7da;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* گزارشات حسابداری */
.reports {
    padding: 20px;
    font-family: 'Yekan', 'Iran', sans-serif;
}

.reports h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.controls {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filter {
    margin-bottom: 15px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.btn-search {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-search:hover {
    background-color: #218838;
}

.document-list {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.document-list h3 {
    padding: 15px;
    margin: 0;
    background-color: #f1f1f1;
    border-bottom: 1px solid #ddd;
}

.document-list table {
    width: 100%;
    border-collapse: collapse;
}

.document-list th {
    background-color: #343a40;
    color: white;
    padding: 12px;
    text-align: right;
}

.document-list td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: right;
}

.document-list tr:hover {
    background-color: #f8f9fa;
}

.document-list tr.unbalanced {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { background-color: rgba(255, 0, 0, 0.1); }
    50% { background-color: rgba(255, 0, 0, 0.3); }
    100% { background-color: rgba(255, 0, 0, 0.1); }
}

.actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-view, .btn-copy {
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-view {
    background-color: #17a2b8;
    color: white;
}

.btn-view:hover {
    background-color: #138496;
}

.btn-copy {
    background-color: #6c757d;
    color: white;
}

.btn-copy:hover {
    background-color: #5a6268;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.pagination {
    display: flex;
    justify-content: center;
    padding: 15px;
    gap: 5px;
}

.page-link {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #007bff;
}

.page-link:hover {
    background-color: #f8f9fa;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* استایل‌های جدید برای صفحه ثبت سند */
.document-entry {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    align-items: center;
    position: relative;
}

.item-row > .form-group {
    flex: 1;
    min-width: 200px;
}

.account-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.account-display {
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    min-height: 38px;
}

.btn-select-account {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-select-account:hover {
    background: #2980b9;
}

.item-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
}

.btn-copy, .btn-remove {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.btn-copy {
    background: #2ecc71;
    color: white;
}

.btn-copy:hover {
    background: #27ae60;
}

.btn-remove {
    background: #e74c3c;
    color: white;
}

.btn-remove:hover {
    background: #c0392b;
}

.summary-box {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    flex-wrap: wrap;
    gap: 10px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.summary-item span:first-child {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

#total-debit, #total-credit {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

#total-diff {
    font-size: 1.2rem;
    font-weight: bold;
}

#total-diff.balanced {
    color: #27ae60;
}

#total-diff.positive {
    color: #e74c3c;
}

#total-diff.negative {
    color: #3498db;
}

/* استایل‌های مودال */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    left: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.account-item:last-child {
    border-bottom: none;
}

.account-item:hover {
    background: #f1f1f1;
}

.account-item.back {
    background: #f8f9fa;
    font-weight: bold;
    color: #3498db;
}

.account-info {
    flex: 1;
}

.account-code {
    font-weight: bold;
    color: #333;
}

.account-name {
    color: #666;
}

.account-buttons {
    display: flex;
    gap: 5px;
}

.account-buttons button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-select {
    background: #4CAF50;
    color: white;
}

.btn-expand {
    background: #2196F3;
    color: white;
}

.btn-back {
    background: #f44336;
    color: white;
}

.no-accounts {
    text-align: center;
    padding: 20px;
    color: #666;
}

.account-actions {
    margin-top: 10px;
    text-align: center;
}

#add-new-account-btn {
    width: 100%;
    padding: 10px;
    background: #607d8b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#add-account-view {
    padding: 15px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#cancel-add-account {
    background: #f44336;
    color: white;
}

.parent-account-group .parent-select {
    max-height: 150px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .item-row {
        flex-direction: column;
    }
    
    .item-actions {
        align-self: center;
    }
    
    .summary-box {
        flex-direction: column;
    }
}

/* استایل‌های جدید برای صفحه گزارشات */
.reports {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.document-list {
    margin-top: 20px;
    overflow-x: auto;
}

.document-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.document-list th, 
.document-list td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.document-list th {
    background-color: #2c3e50;
    color: white;
    font-weight: bold;
}

.document-list tr:hover {
    background-color: #f8f9fa;
}

.document-list tr.unbalanced {
    background-color: rgba(255, 0, 0, 0.05);
}

.actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-view {
    padding: 5px 10px;
    background-color: #17a2b8;
    color: white;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-view:hover {
    background-color: #138496;
}

/* استایل برای اعداد */
td:nth-child(4), 
td:nth-child(5), 
td:nth-child(6) {
    font-family: 'Yekan', 'Iran', sans-serif;
    text-align: left;
    direction: ltr;
    padding-left: 20px;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .document-list th, 
    .document-list td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .btn-view {
        padding: 3px 6px;
        font-size: 0.8rem;
    }
}

/* استایل‌های جدید برای مودال حساب */
.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.account-item:last-child {
    border-bottom: none;
}

.account-item:hover {
    background: #f1f1f1;
}

.account-item.back {
    background: #f8f9fa;
    font-weight: bold;
    color: #3498db;
}

.account-info {
    flex: 1;
}

.account-code {
    font-weight: bold;
    color: #333;
}

.account-name {
    color: #666;
}

.account-buttons {
    display: flex;
    gap: 5px;
}

.account-buttons button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-select {
    background: #4CAF50;
    color: white;
}

.btn-expand {
    background: #2196F3;
    color: white;
}

.btn-back {
    background: #f44336;
    color: white;
}

.no-accounts {
    text-align: center;
    padding: 20px;
    color: #666;
}

.account-actions {
    margin-top: 10px;
    text-align: center;
}

#add-new-account-btn {
    width: 100%;
    padding: 10px;
    background: #607d8b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#add-account-view {
    padding: 15px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#cancel-add-account {
    background: #f44336;
    color: white;
}

.parent-account-group .parent-select {
    max-height: 150px;
    overflow-y: auto;
}

/* Document Actions */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-view {
    background-color: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-copy {
    background-color: #2ecc71;
    color: white;
    border: 1px solid #27ae60;
}

.btn-copy:hover {
    background-color: #27ae60;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
    cursor: pointer;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

.btn-confirm-delete {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-confirm-delete:hover {
    background-color: #c0392b;
}

/* Font Awesome icons */
.fas {
    font-size: 0.9rem;
}

/* تعریف دکمه ویرایش */
.btn-edit {
    background: #f39c12; /* رنگ نارنجی */
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-edit:hover {
    background: #e67e22; /* رنگ نارنجی تیره در حالت hover */
}

/* اضافه کردن استایل برای دکمه ویرایش در جداول */
.actions .btn-edit {
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

/* اضافه کردن آیکون (اختیاری) */
.btn-edit i {
    margin-right: 5px;
}

    .items-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }
    
    .items-table th, .items-table td {
        padding: 12px 15px;
        text-align: right;
        border: 1px solid #ddd;
    }
    
    .items-table th {
        background-color: #2f2ff2;
        font-weight: bold;
    }
    
    .items-table tr:nth-child(even) {
        background-color: #f9f9f9;
    }
    
    .text-right {
        text-align: right;
    }
    
    .balanced {
        color: green;
    }
    
    .positive {
        color: blue;
    }
    
    .negative {
        color: red;
    }
    
    /* استایل‌های مخصوص چاپ */
    @media print {
        .actions {
            display: none !important;
        }
        
        .document-view {
            padding: 0;
        }
        
        .items-table {
            border: 2px solid #000;
        }
        
        .items-table th, .items-table td {
            border: 1px solid #000;
            padding: 8px 10px;
        }
        
        .items-table th {
            background-color: #ddd !important;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }
        
        .summary-box {
            border: 1px solid #000;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }
        
        h2, h3 {
            color: #000 !important;
            text-align: center;
        }
        
        @page {
            size: A4;
            margin: 15mm 10mm;
        }
        
        body {
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }
    }
    
    /* گزارشات حسابداری - استایل‌های نهایی */
.reports {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Yekan', 'Iran', sans-serif;
}

.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.reports h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.8rem;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.per-page-selector label {
    font-weight: 600;
    color: #555;
}

.per-page-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-family: 'Yekan', 'Iran', sans-serif;
}

.document-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    border: 1px solid #ddd;
}

.documents-table th,
.documents-table td {
    padding: 12px 15px;
    text-align: right;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.documents-table th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #ddd;
}

.documents-table tr:last-child td {
    border-bottom: none;
}

.documents-table tr:hover {
    background-color: #f8f9fa;
}

.documents-table tr.unbalanced {
    background-color: rgba(255, 0, 0, 0.05);
}

.documents-table .number {
    font-family: 'Yekan', 'Iran', sans-serif;
    text-align: left;
    direction: ltr;
    padding-left: 20px;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #777;
}

.actions {
    min-width: 200px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-view {
    background-color: #3498db;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-edit {
    background-color: #f39c12;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.btn-delete {
    background-color: #e74c3c;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.btn-copy {
    background-color: #2ecc71;
}

.btn-copy:hover {
    background-color: #27ae60;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px;
    gap: 5px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #f1f1f1;
}

.page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal h3 {
    margin-top: 0;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal p {
    margin: 15px 0;
    color: #555;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

.btn-confirm-delete {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-confirm-delete:hover {
    background-color: #c0392b;
}

/* Responsive */
@media (max-width: 768px) {
    .reports-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .documents-table th, 
    .documents-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        gap: 5px;
    }
    
    .btn-action {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 15px;
    }
}

.modal-content {
  max-height: 500px;
  overflow-y: auto; 
  padding: 20px; 
}

/* استایل‌های جدید برای مدیریت سرفصل‌ها */
.accounts-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.actions {
    display: flex;
    gap: 10px;
}

.accounts-tree-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.tree-view {
    font-family: 'Yekan', 'Iran', sans-serif;
    min-width: 600px;
}

.account-item {
    margin-bottom: 5px;
}

.account-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.account-header:hover {
    background: #e9ecef;
}

.toggle-children {
    width: 20px;
    text-align: center;
    font-weight: bold;
    margin-left: 10px;
}

.account-code {
    font-weight: bold;
    color: #2c3e50;
    min-width: 100px;
}

.account-name {
    flex: 1;
    color: #495057;
}

.account-level-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.level-کل {
    background-color: #d4edda;
    color: #155724;
}

.level-معین {
    background-color: #cce5ff;
    color: #004085;
}

.level-تفصیلی {
    background-color: #fff3cd;
    color: #856404;
}

.children-container {
    margin-right: 30px;
    margin-top: 5px;
    display: none;
}

.level-1 {
    border-left: 4px solid #3498db;
}

.level-2 {
    border-left: 4px solid #2ecc71;
    margin-right: 20px;
}

.level-3 {
    border-left: 4px solid #f39c12;
    margin-right: 40px;
}

/* استایل‌های مودال */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal h3 {
    margin-top: 0;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.account-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.btn-refresh-accounts {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    color: #6c757d;
}

.btn-refresh-accounts:hover {
    color: #3498db;
}

/* Reports Page Styles */
.reports {
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.reports-header {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reports-header h2 {
    color: #333;
    margin: 0;
}

.filters {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex-grow: 1;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-filter {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-filter:hover {
    background-color: #45a049;
}

.btn-clear {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-clear:hover {
    background-color: #d32f2f;
}

.document-list {
    margin-top: 20px;
}

.table-container {
    overflow-x: auto;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.documents-table th {
    background-color: #4CAF50;
    color: white;
    padding: 12px 15px;
    text-align: right;
}

.documents-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    text-align: right;
}

.documents-table tr:hover {
    background-color: #f5f5f5;
}

.documents-table tr.unbalanced {
    background-color: #ffebee;
}

.documents-table tr.unbalanced:hover {
    background-color: #ffcdd2;
}

.number {
    font-family: 'Courier New', monospace;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #777;
}

.actions {
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-action {
    padding: 5px 8px;
    border-radius: 3px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.btn-view {
    background-color: #2196F3;
}

.btn-edit {
    background-color: #FFC107;
}

.btn-delete {
    background-color: #F44336;
    border: none;
    cursor: pointer;
}

.btn-copy {
    background-color: #9C27B0;
}

.btn-action:hover {
    opacity: 0.8;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.page-link:hover {
    background-color: #f5f5f5;
}

.page-link.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 5px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-confirm-delete {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.alert.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Add these new styles to your existing CSS file */

.full-width-search {
    width: 100%;
    margin-bottom: 20px;
}

.full-width-search form {
    display: flex;
}

.full-width-search input {
    flex-grow: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.full-width-search button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.full-width-search button:hover {
    background-color: #45a049;
}

.btn-items {
    background-color: #607d8b;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-items:hover {
    background-color: #546e7a;
}

.btn-documents {
    background-color: #2196F3;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-documents:hover {
    background-color: #0b7dda;
}

/* Responsive adjustments for items table */
@media (max-width: 1200px) {
    .documents-table th:nth-child(5),
    .documents-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 992px) {
    .documents-table th:nth-child(4),
    .documents-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .documents-table th:nth-child(3),
    .documents-table td:nth-child(3),
    .documents-table th:nth-child(9),
    .documents-table td:nth-child(9) {
        display: none;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .document-view, .document-view * {
        visibility: visible;
    }
    
    .document-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .full-width-search, .filters, .actions, .pagination {
        display: none !important;
    }
    
    .document-view h2 {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .summary-box {
        background: #f5f5f5;
        border: 1px solid #ddd;
        padding: 10px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-around;
    }
    
    .summary-item {
        text-align: center;
        padding: 0 15px;
    }
    
    .summary-item span {
        display: block;
        font-weight: bold;
    }
    
    .items-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }
    
    .items-table th, .items-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: right;
    }
    
    .items-table th {
        background-color: #f2f2f2;
    }
    
    .text-right {
        text-align: right !important;
    }
    
    .balanced {
        color: #4CAF50;
    }
    
    .positive {
        color: #2196F3;
    }
    
    .negative {
        color: #F44336;
    }
    
    @page {
        size: A4 portrait;
        margin: 1cm;
    }
}

/* استایل دکمه‌های گزارشات */
.report-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.btn-report {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background-color: #4a6fdc;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-report:hover {
    background-color: #3a5bc7;
}

.btn-report i {
    font-size: 14px;
}

/* Balance Sheet Report Styles */
.balance-sheet-report {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Yekan', 'Iran', sans-serif;
}

.balance-sheet-report h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.account-breadcrumb {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    direction: rtl;
}

.account-breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.account-breadcrumb a:hover {
    text-decoration: underline;
}

.balance-sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.balance-sheet-table th {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
}

.balance-sheet-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    text-align: right;
}

.balance-sheet-table tr:hover {
    background-color: #f5f5f5;
}

.balance-sheet-table .number {
    font-family: 'Yekan', 'Iran', sans-serif;
    text-align: left;
    direction: ltr;
    padding-left: 20px;
}

.balance-sheet-table .level-1 td:first-child {
    padding-right: 20px;
    font-weight: bold;
}

.balance-sheet-table .level-2 td:first-child {
    padding-right: 40px;
}

.balance-sheet-table .level-3 td:first-child {
    padding-right: 60px;
}

.balance-sheet-table .grand-totals {
    font-weight: bold;
    background-color: #f8f9fa;
}

.balance-sheet-table .grand-totals td {
    border-top: 2px solid #2c3e50;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #777;
}

/* Filters */
.filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex-grow: 1;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-filter {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-filter:hover {
    background-color: #45a049;
}

.btn-clear {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-clear:hover {
    background-color: #d32f2f;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .balance-sheet-table th,
    .balance-sheet-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .balance-sheet-table .level-1 td:first-child {
        padding-right: 10px;
    }
    
    .balance-sheet-table .level-2 td:first-child {
        padding-right: 20px;
    }
    
    .balance-sheet-table .level-3 td:first-child {
        padding-right: 30px;
    }
}

.balance-sheet-table {
    border-collapse: collapse;
    width: 100%;
}

.balance-sheet-table th, 
.balance-sheet-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

.balance-sheet-table th {
    background-color: #2f2ff2;
}

.number {
    text-align: left;
    direction: ltr;
}

@media print {
    /* استایل‌های عمومی چاپ */
    body * {
        visibility: hidden;
    }
    
    .balance-sheet-report, 
    .balance-sheet-report * {
        visibility: visible;
    }
    
    .balance-sheet-report {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* مخفی کردن عناصر غیرضروری */
    .filters, 
    .actions, 
    .account-breadcrumb {
        display: none !important;
    }
    
    /* استایل‌های جدول */
    .balance-sheet-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }
    
    .balance-sheet-table th, 
    .balance-sheet-table td {
        border: 1px solid #000;
        padding: 8px;
        text-align: right;
    }
    
    .balance-sheet-table th {
        background-color: #ddd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .balance-sheet-table .number {
        text-align: left;
        direction: ltr;
    }
    
    .grand-totals {
        font-weight: bold;
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    @page {
        size: A4;
        margin: 15mm 10mm;
    }
    
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.summary-row {
    background-color: #f0f7ff;
    font-weight: bold;
    border-top: 2px solid #4a90e2;
}

.summary-row td {
    padding: 12px 8px;
}

/* Tree View Styles */
.balance-sheet-tree-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.balance-sheet-tree-table th {
    background-color: #f5f5f5;
    padding: 10px;
    text-align: right;
    border: 1px solid #ddd;
}

.balance-sheet-tree-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    text-align: right;
}

.balance-sheet-tree-table .account-code {
    text-align: right;
    direction: ltr;
}

.balance-sheet-tree-table .tree-indent {
    display: flex;
    align-items: center;
}

.balance-sheet-tree-table .tree-toggle {
    cursor: pointer;
    margin-left: 5px;
    margin-right: 5px;
    user-select: none;
}

.balance-sheet-tree-table .tree-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-weight: bold;
}

.balance-sheet-tree-table .tree-leaf {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 5px;
    margin-right: 5px;
}

.balance-sheet-tree-table .number {
    text-align: left;
    direction: ltr;
}

.balance-sheet-tree-table tr.level-1 > td {
    font-weight: bold;
}

.balance-sheet-tree-table tr.level-2 > td {
    padding-right: 20px;
}

.balance-sheet-tree-table tr.level-3 > td {
    padding-right: 40px;
}

.modal-content h2 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 1.5rem;
}