* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    width: 100%;
}

.btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    border: none;
    border-radius: 15px;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    cursor: not-allowed;
}

.btn-secondary:not(:disabled) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    cursor: pointer;
}

.btn-secondary:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.3);
}

.btn-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.btn-text {
    font-size: 1rem;
    font-weight: 500;
}

/* صفحة رصيد البنك */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px 0;
}

.back-btn {
    position: absolute;
    right: 0;
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container {
    background: white;
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    margin-top: 20px;
}

.saved-banks {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.saved-banks h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.banks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.saved-bank-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.remove-btn {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: rgba(255,255,255,0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.balance-form {
    margin-top: 20px;
}

.bank-item {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 15px;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease;
}

.bank-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.bank-select, .currency-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.bank-select:focus, .currency-select:focus {
    outline: none;
    border-color: #667eea;
}

.balance-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.balance-input-group input {
    flex: 1;
    padding: 20px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.3rem;
    font-family: 'Tajawal', monospace;
    text-align: left;
    transition: border-color 0.3s ease;
    min-height: 60px;
}

.balance-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.balance-input-group select {
    min-width: 110px;
    padding: 20px 12px;
    font-size: 1.1rem;
    min-height: 60px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.remove-field-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.remove-field-btn:hover {
    background: #c82333;
}

/* المودال */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* صفحة وارد ومنصرف البنوك */
.transaction-type-selector {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.transaction-type-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

.radio-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    background: white;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    font-weight: 500;
}

.radio-label:hover {
    border-color: #667eea;
}

.radio-label input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #667eea;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.transaction-form {
    margin-top: 20px;
}

.optional-group {
    opacity: 0.8;
}

.optional-text {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: normal;
}

.transaction-form .form-group {
    margin-bottom: 18px;
}

.transaction-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

.transaction-form input[type="text"] {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
    min-height: 50px;
}

.transaction-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.transaction-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.transaction-form .form-actions .btn {
    flex: 1;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
}

/* صفحة تسجيلات الشيكات */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 5px;
    border-radius: 15px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
}

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

.cheque-form {
    margin-top: 20px;
}

.cheque-form .form-group {
    margin-bottom: 18px;
}

.cheque-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

.cheque-form input[type="text"],
.cheque-form input[type="date"],
.cheque-form select,
.cheque-form textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.cheque-form input[type="text"]:focus,
.cheque-form input[type="date"]:focus,
.cheque-form select:focus,
.cheque-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.cheque-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cheque-form .form-actions .btn {
    flex: 1;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
}

/* الفلاتر */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* قائمة الشيكات */
.cheques-list {
    max-height: 500px;
    overflow-y: auto;
}

.cheque-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cheque-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.cheque-item.cashed {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
}

.cheque-item.cancelled {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, rgba(220, 53, 69, 0.1) 100%);
}

.cheque-item.overdue {
    border-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, rgba(255, 193, 7, 0.1) 100%);
}

.cheque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cheque-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.status-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.cheque-item.cashed .status-badge {
    background: #28a745;
}

.cheque-item.cancelled .status-badge {
    background: #dc3545;
}

.cheque-item.overdue .status-badge {
    background: #ffc107;
    color: #333;
}

.cheque-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.no-cheques {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1rem;
}

/* تفاصيل الشيك */
.detail-row {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    color: #333;
    display: inline-block;
    min-width: 120px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

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

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

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

/* إحصائيات الشيكات */
.statistics-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.statistics-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.stat-card {
    background: white;
    padding: 20px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.pending {
    border-top: 4px solid #667eea;
}

.stat-card.overdue {
    border-top: 4px solid #ffc107;
}

.stat-card.cashed {
    border-top: 4px solid #28a745;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.totals-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.totals-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
}

.totals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.total-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
}

.total-amount {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.total-currency {
    font-size: 0.9rem;
    opacity: 0.9;
}

.no-totals {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 8px 15px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* صفحة متابعة التحويلات */
.transfer-form {
    margin-top: 20px;
}

.transfer-form .form-group {
    margin-bottom: 18px;
}

.transfer-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

.transfer-form input[type="text"],
.transfer-form input[type="date"],
.transfer-form select,
.transfer-form textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.transfer-form input[type="text"]:focus,
.transfer-form input[type="date"]:focus,
.transfer-form select:focus,
.transfer-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.transfer-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.transfer-form .form-actions .btn {
    flex: 1;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
}

.exchange-rate-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exchange-rate-group input {
    flex: 1;
}

.rate-info {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
}

.currency-symbol {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 12px;
    border-radius: 10px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    font-size: 0.9rem;
}

/* قائمة التحويلات */
.transfers-list {
    max-height: 500px;
    overflow-y: auto;
}

.transfer-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.transfer-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.transfer-header h4 {
    margin: 0;
    color: #28a745;
    font-size: 1.3rem;
    font-weight: bold;
}

.date-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.transfer-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.no-transfers {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1rem;
}

/* إحصائيات التحويلات */
.statistics-section .stat-card.dollar {
    border-top: 4px solid #28a745;
}

.statistics-section .stat-card.local {
    border-top: 4px solid #ffc107;
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .btn {
        padding: 20px 15px;
        min-height: 100px;
    }
    
    .btn-icon {
        font-size: 1.5rem;
    }
    
    .btn-text {
        font-size: 0.9rem;
    }

    .form-container {
        padding: 20px;
    }

    .balance-input-group {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }
}
