﻿body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

hr.dashed {
    border-top: 3px dashed #bbb;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #333;
}

input, button {
    padding: 10px;
    margin: 5px 0;
    width: 100%;
    box-sizing: border-box;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

    button:hover {
        background-color: #45a049;
    }

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

.small-action-btn {
    font-size: 12px;
    padding: 2px 8px;
    margin-left: 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

    .small-action-btn.edit {
        background: #f0ad4e;
        color: #fff;
    }

    .small-action-btn.delete {
        background: #d9534f;
        color: #fff;
    }

    .small-action-btn.edit:hover {
        background: #ec971f;
    }

    .small-action-btn.delete:hover {
        background: #c9302c;
    }

.saved-trips-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
    gap: 8px;
}

    .saved-trips-container select,
    .saved-trips-container button {
        width: 180px;
        max-width: 100%;
        font-size: 1rem;
        padding: 8px 12px;
        box-sizing: border-box;
    }

    .saved-trips-container button {
        background: #4CAF50;
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.2s;
    }

        .saved-trips-container button:hover {
            background: #388e3c;
        }

        .saved-trips-container button:nth-child(3) {
            background: #e53935;
            color: #fff;
            border: none;
            border-radius: 4px;
            margin-left: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }

            .saved-trips-container button:nth-child(3):hover {
                background: #b71c1c;
            }

.expense-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

    .expense-table th, .expense-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }

    .expense-table th {
        background-color: #f2f2f2;
    }

    /* Đảm bảo các nút nằm trên một hàng và có khoảng cách */
    .expense-table button {
        display: inline-block;
        margin-right: 6px;
        padding: 4px 12px;
        border: none;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
    }

    /* Nút Sửa */
    .expense-table button.edit-btn {
        background-color: #1976d2;
        color: #fff;
    }

    .expense-table button.edit-btn:hover {
        background-color: #1565c0;
    }

    /* Nút Xóa */
    .expense-table button.delete-btn {
        background-color: #e53935;
        color: #fff;
    }

    .expense-table button.delete-btn:hover {
        background-color: #b71c1c;
    }

/* Đảm bảo bảng co giãn tốt trên mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Cho phép cuộn ngang nếu bảng quá rộng */
}

/* Bảng tự co giãn, không bị bóp nhỏ quá */
.expense-table1 {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
    background: #fff;
}

/* Các ô cho phép xuống dòng */
.expense-table1 th, .expense-table1 td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
/*    white-space: normal;       Cho phép xuống dòng 
    word-break: break-word;    Tự động xuống dòng khi dài */
}

/* Cột chức năng nhỏ gọn, không tràn, cho phép xuống dòng */
.expense-table1 th:last-child,
.expense-table1 td:last-child {
    width: 80px;
    min-width: 50px;
    max-width: 100px;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    padding-left: 2px;
    padding-right: 2px;
}

/* Nút nhỏ gọn, icon căn giữa */
.expense-table1 .action-buttons {
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.expense-table1 button.edit-btn,
.expense-table1 button.delete-btn {
    padding: 2px 4px;
    min-width: 24px;
    height: 28px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 2px;
}

.expense-table1 button.edit-btn {
    background-color: #1976d2;
    color: #fff;
}
.expense-table1 button.edit-btn:hover {
    background-color: #1565c0;
}

.expense-table1 button.delete-btn {
    background-color: #e53935;
    color: #fff;
}
.expense-table1 button.delete-btn:hover {
    background-color: #b71c1c;
}

.expense-table1 button.edit-btn svg,
.expense-table1 button.delete-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.beneficiaries-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

    .beneficiaries-table th, .beneficiaries-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }
    .beneficiaries-table th {
        background-color: #f2f2f2;
    }

#memberList button {
    display: inline-block;
    margin-right: 6px;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* Nút Sửa */
#memberList button.edit-btn {
    background-color: #1976d2;
    color: #fff;
}

#memberList button.edit-btn:hover {
    background-color: #1565c0;
}

/* Nút Xóa */
#memberList button.delete-btn {
    background-color: #e53935;
    color: #fff;
}

#memberList button.delete-btn:hover {
    background-color: #b71c1c;
}

#result {
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    background: #f9fff9;
    min-height: 40px;
    box-shadow: 0 2px 8px rgba(76,175,80,0.07);
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.edit-btn, .delete-btn {
    padding: 4px 6px;
    min-width: 32px;
    height: 32px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 4px;
}

.edit-btn {
    background-color: #1976d2;
    color: #fff;
}
.edit-btn:hover {
    background-color: #1565c0;
}

.delete-btn {
    background-color: #e53935;
    color: #fff;
}
.delete-btn:hover {
    background-color: #b71c1c;
}

/* Đảm bảo icon không bị to quá */
.edit-btn svg, .delete-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.payer-name {
    color: #1976d2;
    font-weight: bold;
}
.receiver-name {
    color: #e53935;
    font-weight: bold;
}

