/* &#1506;&#1497;&#1510;&#1493;&#1489; &#1502;&#1506;&#1512;&#1499;&#1514; &#1514;&#1494;&#1512;&#1497;&#1501; - Tazrimoney Style */
* {
    box-sizing: border-box;
}

.cashflow-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    direction: rtl;
    background: #f8f9fa;
}

/* &#1499;&#1493;&#1514;&#1512;&#1514; &#1512;&#1488;&#1513;&#1497;&#1514; */
.cashflow-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cashflow-header h1 {
    color: #0077b6;
    font-size: 36px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.cashflow-header p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* &#1499;&#1512;&#1496;&#1497;&#1505;&#1497; &#1505;&#1497;&#1499;&#1493;&#1501; */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.summary-card.income {
    border-top-color: #28a745;
}

.summary-card.expense {
    border-top-color: #dc3545;
}

.summary-card.balance {
    border-top-color: #00a8e8;
}

.summary-card h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-card .amount {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.summary-card.income .amount {
    color: #28a745;
}

.summary-card.expense .amount {
    color: #dc3545;
}

.summary-card.balance .amount {
    color: #00a8e8;
}

/* &#1496;&#1488;&#1489;&#1497;&#1501; */
.tabs-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
}

.tab {
    flex: 1;
    padding: 18px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
}

.tab:hover {
    background: rgba(0, 168, 232, 0.05);
    color: #00a8e8;
}

.tab.active {
    color: #00a8e8;
    background: white;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #00a8e8;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* &#1496;&#1493;&#1508;&#1505; &#1492;&#1493;&#1505;&#1508;&#1492; */
.add-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00a8e8;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* &#1499;&#1508;&#1514;&#1493;&#1512;&#1497;&#1501; */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #00a8e8 0%, #0077b6 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 232, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}

/* &#1496;&#1489;&#1500;&#1492; */
.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead {
    background: #f8f9fa;
}

.items-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    font-size: 14px;
}

.items-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.items-table tr:hover {
    background: #f8f9fa;
}

.amount-income {
    color: #28a745;
    font-weight: 600;
}

.amount-expense {
    color: #dc3545;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-paid {
    background: #d4edda;
    color: #155724;
}

/* &#1492;&#1493;&#1491;&#1506;&#1493;&#1514; */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

/* &#1512;&#1505;&#1508;&#1493;&#1504;&#1505;&#1497;&#1489;&#1497;&#1493;&#1514; */
@media (max-width: 768px) {
    .cashflow-container {
        padding: 10px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .items-table {
        font-size: 14px;
    }
    
    .items-table th,
    .items-table td {
        padding: 10px 8px;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00a8e8;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}