/* css/style.css */

/* --- General Body and Layout --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* --- Header --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.main-header h1 {
    margin: 0;
    font-size: 28px;
    color: #2c3e50;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}
.btn-primary:hover { background-color: #2980b9; }

.btn-secondary {
    background-color: #7f8c8d;
    color: #fff;
}
.btn-secondary:hover { background-color: #6c7a7b; }

.btn-success {
    background-color: #2ecc71;
    color: #fff;
}
.btn-success:hover { background-color: #27ae60; }

.btn-warning {
    background-color: #f39c12;
    color: #fff;
}
.btn-warning:hover { background-color: #e67e22; }

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}
.btn-danger:hover { background-color: #c0392b; }

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}


/* --- Bills Table (index.php) --- */
.bills-table {
    width: 100%;
    border-collapse: collapse;
}

.bills-table th, .bills-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.bills-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.bills-table tbody tr:hover {
    background-color: #f1f3f5;
}

.bills-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.bills-table .actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}
.bills-table .actions form {
    margin: 0;
}

/* --- Status Indicators --- */
.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-unpaid {
    background-color: #f8d7da;
    color: #721c24;
}


/* --- Bill Form (create-bill.php) --- */
.bill-form fieldset {
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 25px;
}

.bill-form legend {
    padding: 0 10px;
    font-weight: 600;
    color: #495057;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: flex-end; /* Align items to the bottom */
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group-large { flex: 3; }
.form-group-small { flex: 1; }

.bill-form label {
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.bill-form input[type="text"],
.bill-form input[type="number"],
.bill-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box; /* Important */
}
.bill-form input:focus, .bill-form select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.fee-item .remove-fee-item {
    height: 42px; /* Match input height */
    margin-bottom: 2px;
}

#add-fee-item {
    margin-top: -10px;
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}
