/* jeonju/assets/css/settle.css */
.settle-section {
	margin-bottom: 2.5em;
	padding-bottom: 1.5em;
	border-bottom: 1px dashed var(--border-light-color);
}
.settle-section:last-of-type {
	border-bottom: none;
	margin-bottom: 0;
}
.settle-section h3 {
	font-size: 1.2em;
	margin-bottom: 1em;
	color: var(--primary-color);
	border-bottom: 2px solid var(--primary-color);
	padding-bottom: 0.4em;
}
.settle-section h3 i { margin-right: 8px; width: auto; }

#member-management {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 1.5em;
}
#member-name-input {
	flex-grow: 1;
}
#add-member-button {
	padding: 8px 15px;
	background-color: var(--primary-color);
	color: white;
	white-space: nowrap;
	font-size: 1em;
}
#add-member-button:hover {
	opacity: 0.85;
}
#member-list {
	list-style: none;
	padding: 0;
	margin-top: 1em;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
#member-list li {
	background-color: #e9ecef;
	padding: 5px 10px;
	border-radius: 15px;
	font-size: 0.9em;
	display: flex;
	align-items: center;
	gap: 5px;
	margin-bottom: 0;
}
#member-list .remove-member {
	background: none;
	border: none;
	color: var(--text-light-color);
	cursor: pointer;
	padding: 0 2px;
	font-size: 0.9em;
	line-height: 1;
}
#member-list .remove-member:hover {
	color: var(--primary-color);
}

#add-expense-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px 12px;
	margin-bottom: 1.5em;
}
.form-group.payer-group,
.form-group.shared-by-group {
	grid-column: 1 / -1;
}
.payer-label-controls,
.shared-by-label-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	gap: 10px;
	flex-wrap: wrap;
}
.payer-label-controls label,
.shared-by-label-controls label {
	margin-bottom: 0;
	flex-shrink: 0;
}
.selection-controls {
	white-space: nowrap;
	flex-shrink: 0;
	display: flex;
	gap: 6px;
}
.selection-controls button {
	font-size: 0.8em;
	padding: 3px 7px;
	background-color: transparent;
	color: var(--text-light-color);
	border: 1px solid var(--border-light-color);
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.selection-controls button:hover {
	background-color: #e9ecef;
	color: var(--text-color);
	border-color: var(--border-color);
}
.selection-controls .edit-split-button {
	color: var(--secondary-color);
	border-color: var(--secondary-color);
}
.selection-controls .edit-split-button:hover {
	background-color: var(--secondary-color);
	color: white;
}
#expense-payer-pills,
#expense-shared-by {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 5px 0;
	min-height: 30px;
	align-items: center;
	border: 1px solid var(--border-light-color);
	border-radius: 4px;
	padding: 8px;
}
.member-pill {
	display: inline-block;
	background-color: #e9ecef;
	padding: 5px 12px;
	border-radius: 15px;
	font-size: 0.9em;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	user-select: none;
	border: 1px solid transparent;
	color: var(--text-color);
}
.member-pill:hover {
	background-color: #dee2e6;
}
.payer-pill.selected {
	background-color: var(--warning-color);
	color: #333;
	font-weight: 500;
	border-color: #ffc107;
}
.shared-by-pill.selected {
	background-color: var(--success-color);
	color: white;
	font-weight: 500;
	border-color: var(--success-color);
}
#add-expense-button {
	padding: 10px 15px;
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1.1em;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	grid-column: 1 / -1;
}
#add-expense-button:hover {
	opacity: 0.85;
}
#add-expense-button.editing {
	background-color: var(--warning-color);
	color: #333;
}
#add-expense-button.editing:hover {
	background-color: #ffca2c;
	opacity: 1;
	color: #333;
}

.expense-list-table-container {
	max-height: 400px;
	overflow-y: auto;
	margin-bottom: 1.5em;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	background-color: #fff;
}
#expense-list-table {
	width: 100%;
	font-size: 0.9em;
}
#expense-list-table th, #expense-list-table td {
	border-bottom: 1px solid var(--border-light-color);
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
}
#expense-list-table tr:last-child td { border-bottom: none; }
#expense-list-table th:nth-child(1), #expense-list-table td:nth-child(1) { width: 8%; text-align: center; padding: 8px 5px;}
#expense-list-table th:nth-child(2), #expense-list-table td:nth-child(2) { width: 13%; white-space: nowrap;}
#expense-list-table th:nth-child(3), #expense-list-table td:nth-child(3) { width: 27%; white-space: normal; }
#expense-list-table th:nth-child(4), #expense-list-table td:nth-child(4) { text-align: right; width: 15%; white-space: nowrap;}
#expense-list-table th:nth-child(5), #expense-list-table td:nth-child(5) { width: 12%; white-space: normal; }
#expense-list-table th:nth-child(6), #expense-list-table td:nth-child(6) { width: 15%; white-space: normal; }
#expense-list-table th:nth-child(7), #expense-list-table td:nth-child(7) { text-align: center; width: 10%; padding: 8px 5px; }

#expense-list-table .shared-by-list {
	font-size: 0.85em;
	color: var(--text-light-color);
	word-break: keep-all;
}
#expense-list-table .edit-expense,
#expense-list-table .remove-expense {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.9em;
	padding: 2px 4px;
	line-height: 1;
	vertical-align: middle;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}
#expense-list-table tr:hover .edit-expense,
#expense-list-table tr:hover .remove-expense {
	opacity: 1;
}
#expense-list-table .edit-expense { color: var(--secondary-color); }
#expense-list-table .edit-expense:hover { color: var(--hover-accent-color); }
#expense-list-table .remove-expense { color: var(--danger-color); }
#expense-list-table .remove-expense:hover { color: var(--danger-dark-color); }

#settlement-calculation {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
	margin-bottom: 1em;
}
#calculate-settlement-button {
	padding: 10px 15px;
	background-color: var(--secondary-color);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1.1em;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
}
#calculate-settlement-button:hover {
	background-color: var(--hover-accent-color);
	opacity: 1;
}
#settlement-currency {
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid var(--border-color);
	font-size: 0.9em;
	background-color: white;
	font-family: inherit;
	height: auto;
	line-height: normal;
}
#rate-info {
	font-size: 0.8em;
	color: var(--text-light-color);
	margin-left: auto;
	text-align: right;
	flex-basis: 100%;
}
@media (min-width: 600px) {
	#rate-info { flex-basis: auto; margin-top: 0;}
}

#settlement-results {
	margin-top: 1.5em;
	background-color: #f8f9fa;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	padding: var(--base-padding);
	min-height: 50px;
}
#settlement-results h4 {
	margin-top: 0;
	margin-bottom: 1.2em;
	font-size: 1.15em;
	color: var(--primary-color);
	padding-bottom: 0.5em;
	border-bottom: 1px solid var(--border-light-color);
}
#settlement-results h4 i { margin-right: 8px; width: auto; }
#settlement-results ul.transaction-list {
	list-style: none;
	padding: 0;
	margin-bottom: 1.5em;
}
#settlement-results li.transaction-item {
	margin-bottom: 0.6em;
	padding: 12px 15px;
	background-color: white;
	border: 1px solid #eee;
	border-radius: 6px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95em;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
#settlement-results li.transaction-item strong {
	color: var(--primary-color);
	font-weight: 500;
}
#settlement-results li.transaction-item .transaction-arrow {
	color: var(--text-light-color);
	font-size: 0.9em;
}
#settlement-results li.transaction-item .transaction-amount {
	margin-left: auto;
	font-weight: bold;
	color: var(--text-color);
}
#settlement-results .total-expense-info {
	margin-top: 1.5em;
	padding-top: 1em;
	border-top: 1px dashed var(--border-light-color);
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
#settlement-results .total-expense-info h5 {
	margin-bottom: 0;
	font-size: 1em;
	color: var(--text-color);
	flex-shrink: 0;
	margin-right: 10px;
}
#settlement-results .total-expense-info p {
	font-size: 1.1em;
	font-weight: bold;
	color: var(--primary-color);
	margin-bottom: 0;
	text-align: right;
}
#settlement-results .balance-info {
	margin-top: 1.5em;
	font-size: 0.9em;
	padding-top: 1em;
	border-top: 1px dashed var(--border-light-color);
}
#settlement-results .balance-info h5 {
	margin-bottom: 0.5em;
	font-size: 1em;
	color: var(--text-color);
}
#settlement-results .balance-info ul {
	list-style: none;
	padding: 0;
	margin-top: 0.5em;
}
#settlement-results .balance-info li {
	font-size: 0.95em;
	background-color: transparent;
	border: none;
	padding: 6px 0;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0;
}
#settlement-results .balance-info li .balance-status {
	font-size: 0.85em;
	color: var(--text-light-color);
	margin-left: 10px;
}
#settlement-results .rate-disclaimer {
	font-size: 0.8em;
	color: var(--text-light-color);
	margin-top: 1.5em;
	padding-top: 0.8em;
	border-top: 1px solid var(--border-light-color);
	text-align: right;
}

.split-modal-content {
	width: 400px;
}
.split-modal-content .total-amount-display {
	text-align: center;
	margin-bottom: 1.5em;
	font-size: 0.9em;
	color: var(--text-light-color);
}
.split-modal-content .total-amount-display strong {
	font-size: 1.2em;
	color: var(--text-color);
}
.split-modal-content .split-list {
	list-style: none;
	padding: 0;
	margin-bottom: 1.5em;
}
.split-modal-content .split-item {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}
.split-modal-content .split-item label {
	flex-basis: 30%;
	text-align: right;
	font-size: 0.9em;
	color: var(--text-color);
	margin-bottom: 0;
}
.split-modal-content .split-item input {
	flex-grow: 1;
	padding: 6px 10px;
	font-size: 0.95em;
	text-align: right;
}
.split-modal-content .split-validation-message {
	text-align: center;
	color: var(--danger-color);
	font-size: 0.85em;
	min-height: 1.2em;
	margin-bottom: 1em;
}
.split-modal-actions button {
	padding: 8px 18px;
	font-size: 0.95em;
}