/* tools/settle/css/settle_results_responsive.css */
.settlement-controls.result-top-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 1.5em;
	padding: 0.5em 0;
	border-bottom: 1px solid var(--border-light-color);
	justify-content: flex-end;
	flex-wrap: wrap;
}

.settlement-controls.result-top-controls label {
	font-weight: 500;
	margin-left: 10px;
}

.settlement-controls.result-top-controls select {
	padding: 6px 10px;
	font-size: 0.95em;
	min-width: 90px;
	width: auto;
}

.settlement-controls.result-top-controls .rate-timestamp {
	font-size: 0.85em;
	color: var(--text-light-color);
	font-style: italic;
	margin-left: 10px;
}

.settlement-controls.result-top-controls #download-pdf-btn {
	padding: 6px 12px;
	font-size: 0.9em;
	margin-right: auto;
	height: 34px;
}

.settlement-controls.result-top-controls #download-pdf-btn i {
	margin-right: 5px;
}

#settlement-result-display {
	padding: 0;
	background-color: transparent;
	border: none;
	margin-bottom: 1em;
	min-height: 100px;
}

#settlement-result-display.settlement-details h4 {
	margin-top: 0;
	margin-bottom: 1.5em;
	padding-bottom: 0.8em;
	border-bottom: 2px solid var(--primary-color);
	font-size: 1.3em;
	color: var(--primary-color);
	display: flex;
	align-items: center;
}

#settlement-result-display h4 i {
	margin-right: 10px;
	color: inherit;
}

#settlement-result-display .no-data-message {
	color: var(--text-light-color);
	text-align: center;
	padding: 2em 0;
	font-size: 1.1em;
}

.settlement-section {
	margin-bottom: 2.5em;
	padding: 1.5em;
	background-color: #fff;
	border-radius: var(--border-radius);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.settlement-section:last-child {
	margin-bottom: 0.5em;
}

.settlement-section h5 {
	margin-bottom: 1em;
	font-size: 1.1em;
	color: var(--primary-dark-color);
	font-weight: 700;
	border-bottom: 1px solid var(--border-light-color);
	padding-bottom: 0.6em;
}

.settlement-table {
	width: 100%;
	font-size: 0.95em;
	border-collapse: collapse;
}

.settlement-table th,
.settlement-table td {
	border: 1px solid var(--border-light-color);
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
}

.settlement-table thead th {
	background-color: #f8f9fa;
	font-weight: 500;
	position: sticky;
	top: 0;
	z-index: 1;
}

.settlement-table td:first-child,
.settlement-table th:first-child {
	text-align: left;
	font-weight: 500;
	white-space: normal;
}

.settlement-table .summary-table td:first-child,
.settlement-table .summary-table th:first-child {
	width: 25%;
}

.settlement-table .expense-detail-table th {
	font-size: 0.9em;
	white-space: normal;
	vertical-align: middle;
}

.settlement-table .expense-detail-table td:nth-child(2),
.settlement-table .expense-detail-table th:nth-child(2) {
	text-align: left;
	white-space: normal;
	min-width: 150px;
}

.settlement-table .expense-detail-table td.remarks-cell {
	text-align: left;
	white-space: normal;
	font-size: 0.9em;
	min-width: 100px;
}

.settlement-table .expense-detail-table td:nth-child(4) { /* 원금액 */
	font-size: 0.85em;
	color: var(--text-light-color);
}

.settlement-table .expense-detail-table td:nth-child(6),
.settlement-table .expense-detail-table th:nth-child(6) { /* 지불자 열부터 */
	text-align: left;
	white-space: normal;
	font-size: 0.9em;
	line-height: 1.4;
}

.settlement-table .expense-detail-table td {
	font-size: 0.95em;
}

.settlement-table.expense-detail-table thead th {
	text-align: center;
}

.settlement-table.expense-detail-table thead tr:first-child th {
	border-bottom: none;
	vertical-align: middle;
}

.settlement-table.expense-detail-table thead tr:last-child th {
	border-top: none;
	vertical-align: top;
}

.settlement-table.expense-detail-table thead th[rowspan="2"] {
	vertical-align: middle;
}

.settlement-table .positive {
	color: #198754;
	font-weight: 500;
}

.settlement-table .negative {
	color: #dc3545;
	font-weight: 500;
}

.settlement-table .total-row td {
	font-weight: 700;
	background-color: #f8f9fa;
	border-top: 2px solid var(--border-color);
}

.settlement-table.expense-detail-table tfoot .total-row td {
	font-weight: 700;
	background-color: #f0f2f5;
	border-top: 2px solid var(--border-color);
}

.transactions-list {
	list-style: none;
	padding: 0;
}

.transactions-list li {
	margin-bottom: 10px;
	padding: 12px 15px;
	background-color: #f8f9fa;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border: 1px solid var(--border-light-color);
	flex-wrap: wrap;
	gap: 5px 10px;
}

.transactions-list .payer {
	font-weight: 500;
	color: var(--primary-dark-color);
}

.transactions-list .receiver {
	font-weight: 500;
	color: #2a9d8f;
}

.transactions-list .amount {
	font-weight: 700;
	color: var(--text-color);
	margin-left: auto;
	font-size: 1.05em;
}

.transactions-list i {
	color: var(--text-light-color);
	margin: 0 8px;
}

.expense-remarks-content {
	display: block;
	white-space: pre-wrap;
	word-break: break-all;
}

tr.remarks-row {
	background-color: #fdfdfd;
}

tr.remarks-row td.remarks-full-row {
	text-align: left;
	font-size: 0.85em;
	color: #555;
	padding: 8px 15px 8px 25px;
	white-space: pre-wrap;
	word-break: break-all;
	line-height: 1.4;
	font-style: italic;
	border-bottom: 1px dashed var(--border-light-color) !important;
}


@media (max-width: 768px) {
	.settle-controls-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.settle-controls-bar .main-actions {
		margin-left: 0;
		justify-content: flex-end;
	}

	.modal-content.large {
		max-width: 95%;
		padding: 1.5em;
	}

	.form-row {
		flex-direction: column;
	}

	.form-row .form-group.half {
		width: 100%;
	}

	.checkbox-group {
		max-height: 120px;
	}

	#amount-split-inputs .participant-split-input label {
		width: 80px;
	}

	.custom-table th,
	.custom-table td {
		padding: 8px 10px;
		font-size: 0.85em;
	}

	#expenses-table th:nth-child(2),
	#expenses-table td:nth-child(2),
	#expenses-table th:nth-child(6),
	#expenses-table td:nth-child(6) {
		font-size: 0.85em;
	}

	#expenses-table th:nth-child(3),
	#expenses-table td:nth-child(3) {
		max-width: 120px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.settlement-table {
		font-size: 0.85em;
	}

	.settlement-table th,
	.settlement-table td {
		white-space: nowrap;
	}

	.settlement-table td:first-child,
	.settlement-table th:first-child {
		white-space: normal;
	}

	.settlement-table .expense-detail-table td:nth-child(2), /* 내용 */
	.settlement-table .expense-detail-table td:nth-child(3), /* 비고 */
	.settlement-table .expense-detail-table td:nth-child(6)  /* 지불자부터 */
	{
		white-space: normal;
	}


	.settlement-table .expense-detail-table {
		font-size: 0.9em;
	}

	.transactions-list {
		font-size: 0.9em;
	}

	.summary-bar {
		font-size: 0.95em;
		flex-direction: column;
		align-items: flex-end;
	}

	.summary-bar.expense-summary select {
		height: 32px;
		padding: 4px 6px;
		order: 0;
		margin-right: auto;
		margin-bottom: 5px;
		width: auto;
		min-width: 80px;
	}

	.summary-bar.expense-summary .total-label {
		margin-left: 0;
		align-self: flex-end;
	}

	.summary-bar.expense-summary strong {
		align-self: flex-end;
	}

	.summary-bar .rate-disclaimer-inline {
		align-self: flex-end;
	}

	.multi-input-list .payer-input-item {
		flex-direction: column;
		align-items: stretch;
	}

	.multi-input-list .payer-input-item select,
	.multi-input-list .payer-input-item input[type="number"] {
		width: 100%;
	}

	.multi-input-list .payer-input-item .remove-payer-btn {
		align-self: flex-end;
		margin-top: 5px;
	}

	.payer-controls {
		flex-direction: column;
		align-items: flex-end;
		gap: 5px;
	}

	.settlement-controls.result-top-controls {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.settlement-controls.result-top-controls #download-pdf-btn {
		order: -1;
		margin-right: 0;
		margin-bottom: 10px;
		align-self: flex-start;
	}

	.settlement-controls.result-top-controls .control-group {
		justify-content: flex-end;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.itinerary-controls-bar .control-group,
	.itinerary-controls-bar .action-group,
	.itinerary-controls-bar .export-group {
		flex-basis: 100%; justify-content: center; margin-bottom: 10px;
	}
	.itinerary-controls-bar .export-group { margin-top: 0; }
	.itinerary-controls-bar .action-group { margin-bottom: 0; }

	.itinerary-summary-bar { flex-direction: column; align-items: flex-start; gap: 5px; }
	.itinerary-summary-bar .total-label,
	.itinerary-summary-bar strong { margin-right: 0; }
	.itinerary-summary-bar select,
	.itinerary-summary-bar span { margin-left: 0 !important; width: 100%; text-align: left; }
	.itinerary-summary-bar select { max-width: 100%; }

	#share-current-users-list li { flex-direction: column; align-items: flex-start; gap: 5px;}
	#share-current-users-list .remove-share-user-btn { align-self: flex-end; }

	.settle-controls-bar .control-group,
	.settle-controls-bar .action-group,
	.settle-controls-bar .export-group {
		flex-basis: 100%; justify-content: center; margin-bottom: 10px;
	}
	.settle-controls-bar .export-group { margin-top: 0; }
	.settle-controls-bar .action-group { margin-bottom: 0; }

	.settlement-summary-bar { flex-direction: column; align-items: flex-start; gap: 5px; }
	.settlement-summary-bar .total-label,
	.settlement-summary-bar strong { margin-right: 0; }
	.settlement-summary-bar select,
	.settlement-summary-bar span { margin-left: 0 !important; width: 100%; text-align: left; }
	.settlement-summary-bar select { max-width: 100%; }

	.settlement-controls.result-top-controls #download-pdf-btn {
		width: 100%;
		justify-content: center;
	}
	.settlement-controls.result-top-controls .control-group {
		justify-content: space-between;
	}
	.settlement-controls.result-top-controls .rate-timestamp {
		width: 100%;
		text-align: right;
		margin-top: 5px;
	}
}