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

body {
    font-family: sans-serif;
    line-height: 1.6;
    background-color: #121212;
    color: #e0e0e0;
}

/* --- Payment Overlay Styles --- */
.payment-overlay { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.payment-modal { 
    background-color: #1e1e1e;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 90%;
    max-width: 350px;
}

.payment-modal h2 {
    color: #ffffff;
    margin-bottom: 15px;
}

.payment-modal p {
    color: #cccccc;
    margin-bottom: 25px;
}

.payment-button { 
    display: inline-block; 
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none; 
    text-align: center;
    transition: background-color 0.3s ease;
    margin-bottom: 15px; 
}

.payment-button:hover {
    background-color: #45a049;
}

.payment-button.confirm-button { 
    background-color: #ff9800; 
}

.payment-button.confirm-button:hover {
    background-color: #fb8c00;
}


.message { 
    color: #cccccc; 
    margin-top: 15px;
    min-height: 1.2em;
    font-size: 0.9em;
}

/* --- End Payment Overlay Styles --- */


.hidden {
    display: none !important;
}

.container {
    max-width: 600px;
    margin: 20px auto;
    background: #1e1e1e;
    padding: 15px 25px 25px 25px; 
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5px; 
    background: none;
    padding-top: 15px;
}

#app-logo {
    max-width: 150px; 
    height: auto;
    margin-bottom: 0; 
}

.app-title {
    font-family: sans-serif; 
    font-weight: bold;
    color: #FFD700; 
    text-align: center;
    margin-top: 5px; 
    margin-bottom: 15px; 
    font-size: 1.8em; 
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); 
}

h1, h2 {
    text-align: center;
    margin-bottom: 15px; 
    color: #ffffff;
}

#borrow-form {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2a2a2a;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #cccccc;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
}

.form-group input::placeholder {
    color: #888;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #45a049;
}

#borrowers-list {
    margin-bottom: 30px;
}

.borrower-card {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

.borrower-info {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #ffffff;
}

.borrower-contact {
    font-size: 0.9em;
    color: #aaaaaa;
}

.items-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 10px;
    border-top: 1px dashed #3a3a3a;
    padding-top: 10px;
}

.items-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.95em;
    color: #cccccc;
}

.items-list li.payment-item .item-name {
    font-style: italic;
    color: #8fbc8f;
}

.items-list li.payment-item .item-amount {
    color: #90ee90;
}

.items-list li:not(.payment-item) .item-amount {
    color: #ff6b6b;
}

.item-name {
    flex-grow: 1;
    margin-right: 10px;
}

.item-amount {
    font-weight: bold;
}

.borrower-total {
    text-align: right;
    font-weight: bold;
    margin-top: 10px;
    font-size: 1.1em;
    padding-top: 10px;
    border-top: 1px solid #555;
    color: #ffffff;
}

.borrower-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.action-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: white;
    transition: background-color 0.2s ease;
}

.add-button {
    background-color: #4CAF50;
}

.add-button:hover {
    background-color: #45a049;
}

.subtract-button {
    background-color: #ff9800;
}

.subtract-button:hover {
    background-color: #fb8c00;
}

.delete-button {
    background-color: #f44336;
}

.delete-button:hover {
    background-color: #d32f2f;
}

#grand-total {
    background-color: #333;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-top: 20px;
}

#grand-total h2 {
    margin: 0;
    font-size: 1.3em;
    color: #ffffff;
}

#total-amount {
    font-weight: bold;
    color: #ff6b6b;
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding: 10px;
    font-size: 0.9em;
    color: #aaaaaa;
}

@media (max-width: 480px) {
    .container {
        padding: 10px 15px 15px 15px;
        margin: 15px auto;
    }

    #app-logo {
        max-width: 120px; 
    }

    h2 {
        font-size: 1.2em;
    }

    .payment-modal { 
        padding: 25px 20px;
        width: 85%;
    }

    .payment-button { 
        padding: 10px;
        font-size: 15px;
    }

    button[type="submit"] {
        padding: 10px;
        font-size: 15px;
    }

    .borrower-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .borrower-info {
        margin-bottom: 3px;
    }

    .borrower-contact {
        margin-bottom: 8px;
    }

    .items-list li {
        font-size: 0.9em;
    }

    .action-button {
        padding: 5px 10px;
        font-size: 0.85em;
    }
}