@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');
:root { --primary-color: #4a90e2; --success-color: #28a745; --danger-color: #dc3545; --warning-color: #ffc107; --light-gray: #f4f4f4; --dark-gray: #333; --border-radius: 8px; }
body { font-family: 'Vazirmatn', sans-serif; background-color: var(--light-gray); color: var(--dark-gray); margin: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; padding: 1rem 0; box-sizing: border-box; }
#app-container { background-color: white; padding: 2rem; border-radius: var(--border-radius); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); width: 90%; max-width: 800px; }
.hidden { display: none !important; }
#auth-view form { display: flex; flex-direction: column; gap: 1rem; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea { padding: 0.8rem; border: 1px solid #ccc; border-radius: var(--border-radius); font-size: 1rem; font-family: 'Vazirmatn', sans-serif; box-sizing: border-box; width: 100%; }
textarea { min-height: 80px; resize: vertical; margin-top: .5rem; }
button { padding: 0.8rem 1.5rem; border: none; border-radius: var(--border-radius); background-color: var(--primary-color); color: white; font-family: 'Vazirmatn', sans-serif; font-size: 1rem; cursor: pointer; transition: background-color 0.2s; }
button:hover { background-color: #357abd; }
.toggle-link { color: var(--primary-color); cursor: pointer; text-align: center; font-size: 0.9rem; }
#dashboard-view header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.header-welcome { flex-grow: 1; }
.header-actions { display: flex; gap: 0.5rem; }
#welcome-message { font-weight: bold; font-size: 1.1rem; }
#add-expense-btn { background-color: var(--success-color); }
#add-expense-btn:hover { background-color: #218838; }
#logout-btn { background-color: #6c757d; }
#logout-btn:hover { background-color: #5a6268; }
.profile-section { background-color: #f0f8ff; border: 1px solid #d1e7fd; border-radius: var(--border-radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.profile-section h3 { margin-top: 0; color: var(--primary-color); }
#telegram-connection-status p { margin: 0 0 10px 0; font-size: 0.9rem; }
#telegram-connection-status .connected { color: var(--success-color); font-weight: bold; }
#telegram-connection-status button { font-size: 0.9rem; padding: 0.6rem 1rem; }
#disconnect-telegram-btn { background-color: var(--danger-color); }
.expense-item { background-color: #f9f9f9; border: 1px solid #eee; border-radius: var(--border-radius); padding: 1rem; margin-bottom: 1rem; }
.expense-item-header { display: flex; justify-content: space-between; align-items: center; }
.expense-item-header h3 { margin-top: 0; margin-bottom: 0.5rem; }
p.expense-description { background: #f0f0f0; border-right: 3px solid #ccc; padding: 10px; margin: 10px 0; font-size: 0.9rem; white-space: pre-wrap; }
.participants-list { list-style: none; padding: 0; margin-top: 1rem; }
.participants-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; border-bottom: 1px solid #eee; flex-wrap: wrap; gap: 5px; }
.participants-list li:last-child { border-bottom: none; }
.status { padding: 0.2rem 0.5rem; border-radius: 12px; font-size: 0.8rem; color: white; }
.status.pending { background-color: var(--danger-color); }
.status.paid { background-color: var(--success-color); }
.mark-paid-btn { background-color: #f0f0f0; color: var(--dark-gray); padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.unmark-paid-btn { background-color: var(--warning-color); color: #212529; padding: 0.3rem 0.7rem; font-size: 0.8rem; border: none; border-radius: 4px; cursor: pointer; }
.unmark-paid-btn:hover { background-color: #e0a800; }
.share-link-container { margin-top: 1rem; }
.share-link-container label { font-size: 0.9rem; font-weight: bold; display: block; margin-bottom: 5px; }
.share-link-input-group { display: flex; }
.share-link-input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.copy-link-btn { font-size: 0.9rem; padding: 0.8rem; border-top-left-radius: 0; border-bottom-left-radius: 0; white-space: nowrap; }
.modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; }
.modal-content { background-color: white; padding: 2rem; border-radius: var(--border-radius); width: 90%; max-width: 500px; overflow-y: auto; max-height: 90vh; }
.close-btn { float: left; font-size: 1.5rem; cursor: pointer; }
#participants-container .participant-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.delete-btn { background-color: var(--danger-color); padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 4px; }
.delete-btn:hover { background-color: #c82333; }
.participants-list .delete-btn { padding: 2px 6px; font-size: 1rem; line-height: 1; }
.remove-participant-btn { background: none; border: none; color: var(--danger-color); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 5px; }
.receipt-link { font-size: 0.8em; font-weight: bold; color: var(--primary-color); text-decoration: none; }
.receipt-link:hover { text-decoration: underline; }
.custom-slug-wrapper { margin: 1rem 0; }
.custom-slug-wrapper label { font-weight: bold; font-size: 0.9rem; margin-bottom: 5px; display: block; }
.slug-input-group { display: flex; align-items: center; border: 1px solid #ccc; border-radius: var(--border-radius); }
.slug-input-group span { padding: 0 10px; background-color: #f0f0f0; color: #666; font-size: 0.9rem; border-left: 1px solid #ccc; white-space: nowrap; }
.slug-input-group input { border: none; flex-grow: 1; direction: ltr; }
#slug-feedback { font-size: 0.8rem; display: block; margin-top: 5px; height: 1em; transition: color 0.2s; }
#slug-feedback.available { color: var(--success-color); }
#slug-feedback.unavailable { color: var(--danger-color); }
.equal-split-section { display: flex; gap: 1rem; align-items: center; background-color: #f9f9f9; padding: 1rem; border-radius: var(--border-radius); margin: 1.5rem 0; }
.equal-split-section input[type="number"] { flex-grow: 1; }
.toggle-switch { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.toggle-switch label { cursor: pointer; font-size: 0.9rem; }
.participant-amount:disabled { background-color: #e9ecef; cursor: not-allowed; opacity: 0.7; }
.edit-expense-btn { background-color: var(--warning-color); color: #212529; padding: 0.3rem 0.7rem; font-size: 0.8rem; border: none; border-radius: 4px; cursor: pointer; margin-left: 5px; }
.edit-expense-btn:hover { background-color: #e0a800; }
#toast-message { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: var(--dark-gray); color: white; padding: 1rem 2rem; border-radius: var(--border-radius); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 1001; }
#toast-message.show { opacity: 1; visibility: visible; }
#debug-output { display: none; position: fixed; bottom: 10px; left: 10px; width: calc(100% - 40px); max-height: 200px; overflow-y: auto; background-color: #111; color: #0f0; border: 2px solid #0f0; padding: 10px; font-family: monospace; font-size: 0.8rem; z-index: 9999; white-space: pre-wrap; }
footer { width: 100%; text-align: center; margin-top: 2rem; padding: 1rem 0; font-size: 0.9em; color: #777; }
footer a { color: var(--primary-color); text-decoration: none; font-weight: bold; }
footer a:hover { text-decoration: underline; }

/* ===== استایل جدید برای دکمه رد کردن رسید ===== */
.receipt-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.reject-receipt-btn {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 1px 5px;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.reject-receipt-btn:hover {
    background-color: var(--danger-color);
    color: white;
}