* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
}

h1 i, h2 i {
    margin-left: 10px;
}

/* قسم إضافة المستخدم */
.add-user-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-wrapper .icon-input {
    position: absolute;
    right: 15px;
    color: #667eea;
    font-size: 18px;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
}

.add-user-section input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
}

.add-user-section input:focus {
    outline: none;
    border-color: #667eea;
}

.add-user-section button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-user-section button i {
    font-size: 14px;
}

.add-user-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* قائمة المستخدمين */
.users-list {
    display: grid;
    gap: 15px;
}

.user-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.user-card .user-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.user-card .user-name i {
    color: #667eea;
}

.user-card .delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: background 0.2s;
}

.user-card .delete-btn:hover {
    background: #ff3838;
}

/* قسم إضافة المواد */
.header-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.back-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn i {
    font-size: 14px;
}

.back-btn:hover {
    background: #5a6268;
}

.add-item-section {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 30px;
}

.add-item-section .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.add-item-section .input-wrapper .icon-input {
    position: absolute;
    right: 15px;
    color: #667eea;
    font-size: 18px;
    z-index: 1;
}

.add-item-section .input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
}

.add-item-section input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
}

.add-item-section input:focus {
    outline: none;
    border-color: #667eea;
}

.add-item-section button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-item-section button i {
    font-size: 14px;
}

.add-item-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* قائمة المواد */
.items-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.item-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: center;
    transition: box-shadow 0.2s;
}

.item-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.item-name i {
    color: #667eea;
}

.input-wrapper-item {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-input-item {
    position: absolute;
    right: 10px;
    color: #667eea;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.item-price-input {
    padding: 10px 35px 10px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
    width: 100%;
}

.item-price-input::placeholder {
    color: #999;
    font-style: italic;
}

.item-date-input {
    padding: 10px 35px 10px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: border-color 0.3s;
    width: 100%;
    direction: rtl;
}

.item-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.item-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.item-price-input:focus {
    outline: none;
    border-color: #667eea;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Times New Roman', Times, serif;
    text-align: center;
    transition: transform 0.2s;
}

.item-actions .save-btn {
    background: #28a745;
    color: white;
}

.item-actions .save-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.item-actions .delete-btn {
    background: #ff4757;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.item-actions .delete-btn:hover {
    background: #ff3838;
    transform: scale(1.05);
}

/* قسم الإجمالي */
.total-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.total-section.fixed-top {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.total-section h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
}

#totalAmount {
    font-size: 2rem;
    font-weight: bold;
}

.content-wrapper {
    padding-top: 0;
}

/* رسائل التحذير */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .add-item-section {
        grid-template-columns: 1fr;
    }

    .item-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

