* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    background: #f0f2f5;
    color: #333;
}

.navbar {
    background: #1a237e;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 { font-size: 20px; }

.nav-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: #3949ab;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 { color: #666; font-size: 14px; margin-bottom: 10px; }
.stat-card .number { font-size: 32px; font-weight: bold; color: #1a237e; }
.stat-card.cash .number { color: #2e7d32; }
.stat-card.credit .number { color: #ef6c00; }
.stat-card.danger .number { color: #c62828; }

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
}

.btn-primary { background: #1a237e; color: white; }
.btn-primary:hover { background: #3949ab; }

.btn-success { background: #2e7d32; color: white; }
.btn-success:hover { background: #388e3c; }

.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #d32f2f; }

.btn-warning { background: #ef6c00; color: white; }
.btn-warning:hover { background: #f57c00; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #1a237e;
    color: white;
    font-weight: 500;
}

tr:hover { background: #f5f5f5; }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a237e;
}

.filters {
    background: #e8eaf6;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.filters select,
.filters input {
    padding: 10px;
    border: 1px solid #c5cae9;
    border-radius: 5px;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-cash { background: #c8e6c9; color: #2e7d32; }
.badge-credit { background: #ffe0b2; color: #ef6c00; }
.badge-paid { background: #c8e6c9; color: #2e7d32; }
.badge-unpaid { background: #ffcdd2; color: #c62828; }
.badge-old { background: #fff3e0; color: #ef6c00; }

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success { background: #c8e6c9; color: #2e7d32; }
.alert-error { background: #ffcdd2; color: #c62828; }

.actions a, .actions form { display: inline-block; margin: 0 3px; }

.old-row { background: #fff8e1 !important; }
.new-row { background: #e8f5e9 !important; }

.total-box {
    background: #1a237e;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

.total-box h2 { font-size: 18px; margin-bottom: 10px; }
.total-box .amount { font-size: 36px; font-weight: bold; }