/**
 * Estilos públicos — Barax Canal Rural Cotações.
 */

.crc-cotacoes {
	font-family: 'Inter', system-ui, sans-serif;
}

.crc-cotacoes--error {
	padding: 1rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
}

/* --- Gráfico por tipo --- */
.crc-grafico-type {
	padding: 0;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	border: 1px solid #899193;
	max-width: 100%;
	width: 100%;
}

.crc-grafico-type__select-bar {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	padding: 24px 24px 8px;
}

.crc-grafico-type__select {
	border-radius: 8px;
	padding: 4px 24px 4px 12px;
	font-size: 1rem;
	font-weight: 700;
	color: #155e88;
	border: 2px solid #155e88;
	background: #fff;
	font-family: 'Inter', sans-serif;
	width: min(500px, 100%);
	min-width: 120px;
}

.crc-grafico-type__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	width: 18px;
}

.crc-grafico-type__grid {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 32px;
	padding: 0 24px 24px;
}

.crc-grafico-type__chart-wrap {
	flex: 1;
	max-width: 900px;
	min-width: 320px;
	position: relative;
}

.crc-grafico-type__chart {
	width: 100% !important;
	min-height: 320px !important;
	max-height: 420px !important;
}

.crc-grafico-type__panel {
	border: 2px solid #e2e8f0;
	border-radius: 16px;
	padding: 28px 24px;
	background: #fff;
	min-width: 260px;
	flex: 0 0 320px;
	max-width: 360px;
}

.crc-grafico-type__panel-title {
	margin: 0 0 12px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #155e88;
	word-wrap: break-word;
}

.crc-grafico-type__empty {
	color: #899193;
	font-size: 1.1rem;
}

.crc-grafico-type__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(3.75rem, auto) 1.25rem minmax(4.75rem, auto);
	align-items: center;
	column-gap: 6px;
	margin-bottom: 8px;
	min-height: 2.75rem;
	padding: 6px 0;
	border-bottom: 1px solid #e2e8f0;
}

.crc-grafico-type__row:last-child {
	margin-bottom: 0;
	border-bottom: none;
	padding-bottom: 0;
}

.crc-grafico-type__symbol {
	font-weight: 600;
	color: #155e88;
	font-size: 0.95rem;
	line-height: 1.2;
	min-width: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	word-break: break-word;
	align-self: center;
}

.crc-grafico-type__values {
	display: contents;
}

.crc-grafico-type__pct {
	color: #155e88;
	font-size: 1rem;
	font-weight: 700;
	white-space: nowrap;
	text-align: right;
	justify-self: end;
}

.crc-grafico-type__price {
	color: #899193;
	font-size: 0.95rem;
	white-space: nowrap;
	text-align: right;
	justify-self: end;
}

.crc-grafico-type__arrow-up,
.crc-grafico-type__arrow-down {
	justify-self: center;
	text-align: center;
	font-size: 1rem;
	line-height: 1;
}

.crc-grafico-type__arrow-up { color: #16a34a; }
.crc-grafico-type__arrow-down { color: #dc2626; }

@media (max-width: 991px) {
	.crc-grafico-type__grid {
		flex-direction: column;
		gap: 20px;
	}

	.crc-grafico-type__chart-wrap,
	.crc-grafico-type__panel {
		max-width: 100%;
		min-width: 0;
		flex: 1 1 100%;
	}

	.crc-grafico-type__panel {
		padding: 20px 12px;
	}

	.crc-grafico-type__chart {
		min-height: 280px !important;
		max-height: 350px !important;
	}

	.crc-grafico-type__row {
		grid-template-columns: minmax(0, 1fr) minmax(3.25rem, auto) 1rem minmax(4.25rem, auto);
		column-gap: 4px;
	}
}

/* --- Tabela OHLC --- */
.crc-tabela {
	margin: 24px 0;
}

.crc-tabela__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	gap: 12px;
	flex-wrap: wrap;
}

.crc-tabela__title {
	margin: 0;
	color: #155e88;
	font-size: 1.5rem;
	font-weight: 700;
}

.crc-tabela__updated {
	color: #899193;
}

.crc-tabela__empty {
	padding: 24px;
	background: #fff;
	border-radius: 12px;
	text-align: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.crc-market-table,
.market-data-table {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	margin: 0;
	width: 100%;
}

.crc-market-table thead,
.market-data-table thead {
	background: linear-gradient(135deg, #155e88 0%, #1a6b96 100%);
	color: #fff;
}

.crc-market-table thead th,
.market-data-table thead th {
	border: none;
	padding: 16px 12px;
	font-weight: 600;
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.crc-market-table tbody tr,
.market-data-table tbody tr {
	border-bottom: 1px solid #e9ecef;
	transition: background-color 0.2s ease;
}

.crc-market-table tbody tr:hover,
.market-data-table tbody tr:hover {
	background-color: #f8f9fa;
}

.crc-market-table tbody td,
.market-data-table tbody td {
	padding: 16px 12px;
	vertical-align: middle;
	border: none;
	font-size: 0.9rem;
}

.symbol-cell { font-weight: 600; color: #155e88; }
.price-cell { font-weight: 500; color: #2c3e50; text-align: right; }
.date-cell { color: #6c757d; font-size: 0.85rem; }
.change-cell { text-align: center; }

.change-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.85rem;
}

.change-badge.positive { background-color: #d4edda; color: #155724; }
.change-badge.negative { background-color: #f8d7da; color: #721c24; }

@media (max-width: 767px) {
	.crc-market-table,
	.crc-market-table thead,
	.crc-market-table tbody,
	.crc-market-table th,
	.crc-market-table td,
	.crc-market-table tr,
	.market-data-table,
	.market-data-table thead,
	.market-data-table tbody,
	.market-data-table th,
	.market-data-table td,
	.market-data-table tr {
		display: block;
	}

	.crc-market-table thead tr,
	.market-data-table thead tr {
		position: absolute;
		top: -9999px;
		left: -9999px;
	}

	.crc-market-table tbody tr,
	.market-data-table tbody tr {
		background: #fff;
		border-radius: 12px;
		margin-bottom: 16px;
		padding: 16px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
		border: 1px solid #e9ecef;
	}

	.crc-market-table tbody td,
	.market-data-table tbody td {
		border: none;
		padding: 8px 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.crc-market-table tbody td:before,
	.market-data-table tbody td:before {
		content: attr(data-label) ":";
		font-weight: 600;
		color: #155e88;
		margin-right: 10px;
		min-width: 100px;
		text-align: left;
	}
}

/* --- Resumo home --- */
.crc-resumo {
	width: 100%;
	max-width: 700px;
	margin: 0 auto 24px;
	background: #f1f5f9;
	border-radius: 16px;
	box-shadow: 0 12px 20px -8px rgba(15, 23, 42, 0.25);
	border: 1px solid #e2e8f0;
	overflow: hidden;
}

.crc-resumo__header {
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
	background: #fff;
}

.crc-resumo__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #155e88;
}

.crc-resumo__list {
	padding: 8px 12px 12px;
	max-height: 36.6875rem;
	overflow-y: auto;
}

.crc-resumo__empty {
	padding: 16px;
	color: #64748b;
	font-size: 0.95rem;
}

.crc-resumo__item {
	padding: 10px;
	margin-bottom: 6px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #e2e8f0;
	cursor: pointer;
	transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.crc-resumo__item:hover {
	background: #e3f2fd;
	box-shadow: 0 4px 12px rgba(21, 94, 136, 0.18);
	transform: translateY(-1px);
}

.crc-resumo__category {
	color: #155e88;
	font-size: 15px;
	line-height: 1em;
	font-weight: 800;
	margin-bottom: 8px;
}

.crc-resumo__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.crc-resumo__symbol {
	font-size: 0.85rem;
	color: #64748b;
}

.crc-resumo__price {
	font-size: 0.7rem;
	font-weight: 600;
	color: #155e88;
	white-space: nowrap;
}

.crc-resumo__arrow-up { color: #16a34a; }

.crc-resumo__cta-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 24px;
}

.crc-resumo__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* --- Dashboard hub --- */
.crc-dashboard {
	width: 100%;
	max-width: 90vw;
	min-width: 85vw;
	margin: 0 auto;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.crc-dashboard__mobile-nav {
	display: block;
	background: #fff;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
}

.crc-dashboard__mobile-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.crc-dashboard__mobile-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #155e88;
}

.crc-dashboard__mobile-btn {
	background: #155e88;
	color: #fff;
	border: none;
	padding: 8px 12px;
	border-radius: 6px;
	cursor: pointer;
}

.crc-dashboard__mobile-menu {
	margin-top: 16px;
	background: #f8fafc;
	border-radius: 8px;
	padding: 12px;
}

.crc-dashboard__mobile-menu--hidden {
	display: none;
}

.crc-dashboard__mobile-list,
.crc-dashboard__commodity-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.crc-dashboard__mobile-list li,
.crc-dashboard__commodity-list li {
	padding: 12px 8px;
	margin-bottom: 8px;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #155e88;
	font-weight: 600;
	border: 1px solid #e2e8f0;
}

.crc-dashboard__mobile-list li:hover,
.crc-dashboard__commodity-list li:hover,
.crc-dashboard__commodity-list li.is-selected {
	background: #e3f2fd;
}

.crc-dashboard__desktop {
	display: none;
	grid-template-columns: 200px minmax(420px, 1.6fr) 280px;
	min-height: 560px;
	align-items: stretch;
	background: #fff;
}

.crc-dashboard__sidebar,
.crc-dashboard__closings,
.crc-dashboard__main {
	background: #fff;
}

.crc-dashboard__sidebar,
.crc-dashboard__closings {
	padding: 24px 16px;
	display: flex;
	flex-direction: column;
}

.crc-dashboard__sidebar {
	padding-left: 40px;
}

.crc-dashboard__sidebar-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #155e88;
	margin: 0 0 16px;
}

.crc-dashboard__subtitle {
	color: #899193;
	font-size: 13px;
	font-weight: 500;
	display: block;
}

.crc-dashboard__main {
	padding: 24px 10px 16px;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.crc-dashboard__controls {
	width: 100%;
	margin: 0 0 16px;
	flex-shrink: 0;
}

.crc-dashboard__select-wrap {
	position: relative;
	width: 100%;
}

.crc-dashboard__select {
	appearance: none;
	width: 100%;
	padding: 8px 32px 8px 12px;
	border: 2px solid #155e88;
	border-radius: 8px;
	background: #fff;
	color: #155e88;
	font-weight: 700;
	font-size: 16px;
	text-transform: uppercase;
	cursor: pointer;
}

.crc-dashboard__chart-wrap {
	width: 100%;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 440px;
	position: relative;
	background: #fff;
}

.crc-dashboard__chart {
	display: block;
	width: 100% !important;
	height: 440px !important;
	min-height: 440px !important;
	max-height: 440px !important;
}

.crc-dashboard__closings-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	margin-bottom: 18px;
	flex-shrink: 0;
}

.crc-dashboard__closings-title {
	margin: 0 0 10px;
}

.crc-dashboard__closings-header .crc-dashboard__detail-btn {
	margin: 0 0 18px;
	align-self: flex-start;
}

.crc-dashboard__closings-subtitle {
	margin: 0;
	padding-top: 14px;
}

.crc-dashboard__detail-btn {
	background: #155e88;
	border: none;
	border-radius: 6px;
	padding: 6px 14px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.crc-dashboard__detail-btn--small {
	font-size: 12px;
	padding: 4px 10px;
}

.crc-dashboard__closings-box {
	border: 1px solid #155e88;
	min-height: 0;
	border-radius: 12px;
	overflow: hidden;
	flex: 0 0 auto;
	align-self: stretch;
}

.crc-dashboard__closing-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 8px;
	border-bottom: 1px solid #155e88;
	color: #155e88;
	font-size: 13px;
}

.crc-dashboard__closing-row.is-active {
	background: #155e88;
	color: #fff;
}

.crc-dashboard__closing-row.is-first {
	border-top-left-radius: 12px;
	border-top-right-radius: 12px;
}

.crc-dashboard__closing-row.is-last {
	border-bottom: none;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
}

.crc-dashboard__closing-symbol {
	font-weight: 600;
	flex: 1;
	word-break: break-word;
}

.crc-dashboard__closing-price {
	white-space: nowrap;
	font-weight: 600;
}

.crc-dashboard__mobile-layout {
	display: block;
	padding-bottom: 16px;
}

.crc-dashboard__mobile-section-title {
	margin: 0;
	font-size: 1.1rem;
	color: #155e88;
}

.crc-dashboard__mobile-closings {
	padding: 16px 20px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
}

.crc-detalhe__tabela {
	margin-top: 40px;
}

@media (min-width: 992px) {
	.crc-dashboard__mobile-nav,
	.crc-dashboard__mobile-layout {
		display: none;
	}

	.crc-dashboard__desktop {
		display: grid;
	}
}

@media (max-width: 991px) {
	.crc-dashboard {
		max-width: 100%;
		min-width: 0;
	}
}

div[id^="commodity-dashboard-type-"],
div[id^="crc-grafico-"] {
	background: #fff !important;
}
