/* iOrganic Price Tracker — frontend styles */

.iorg-pt-table-wrap {
	margin: 1.5em 0;
	font-family: inherit;
}

.iorg-pt-table-meta {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	margin-bottom: 0.6em;
	font-size: 0.9em;
	color: #555;
}

.iorg-pt-table-meta .iorg-pt-date { font-weight: 600; }

.iorg-pt-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e5e7eb;
}

.iorg-pt-table thead th {
	background: #f3f4f6;
	color: #111827;
	text-align: left;
	font-weight: 600;
	padding: 0.6em 0.8em;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}

.iorg-pt-table th.num,
.iorg-pt-table td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.iorg-pt-table tbody td {
	padding: 0.55em 0.8em;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: top;
}

.iorg-pt-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.iorg-pt-table .iorg-pt-name {
	font-weight: 600;
	color: #15803d;
}

.iorg-pt-table .iorg-pt-source {
	color: #6b7280;
	font-size: 0.92em;
}

.iorg-pt-table .iorg-pt-avg {
	font-weight: 600;
}

.iorg-pt-disclaimer {
	margin-top: 0.6em;
	font-size: 0.85em;
	color: #9ca3af;
	font-style: italic;
}

.iorg-pt-empty {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 6px;
	padding: 1.2em;
	text-align: center;
	color: #6b7280;
}

.iorg-pt-summary {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 160px, 1fr ) );
	gap: 1em;
	margin: 1.5em 0;
}

.iorg-pt-summary-card {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	padding: 1em;
	text-align: center;
}

.iorg-pt-summary-label {
	font-size: 0.85em;
	color: #166534;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.3em;
}

.iorg-pt-summary-value {
	font-size: 1.7em;
	font-weight: 700;
	color: #14532d;
}

@media ( max-width: 600px ) {
	.iorg-pt-table thead { display: none; }
	.iorg-pt-table tbody td {
		display: block;
		border-bottom: none;
		padding: 0.25em 0.8em;
	}
	.iorg-pt-table tbody tr {
		display: block;
		border-bottom: 1px solid #e5e7eb;
		padding: 0.6em 0;
	}
	.iorg-pt-table .iorg-pt-name { font-size: 1.05em; }
}

/* group title (for [iorganic_price_table group="category"]) */
.iorg-pt-group-title {
	margin: 1.4em 0 0.4em 0;
	font-size: 1.05em;
	font-weight: 700;
	color: #166534;
	border-left: 4px solid #15803d;
	padding-left: 0.6em;
}

/* sparkline */
.iorg-pt-sparkline {
	display: inline-block;
	vertical-align: middle;
	overflow: visible;
}
.iorg-pt-sparkline-up   polyline { stroke: #15803d; }
.iorg-pt-sparkline-down polyline { stroke: #b91c1c; }
.iorg-pt-sparkline-empty {
	color: #d1d5db;
	font-size: 1.4em;
	line-height: 1;
}
.iorg-pt-spark-col, .iorg-pt-spark-cell { width: 100px; }

/* compare blocks */
.iorg-pt-compare {
	margin: 1.5em 0;
}
.iorg-pt-compare-title {
	font-weight: 600;
	margin-bottom: 0.5em;
	color: #14532d;
}

/* chart */
.iorg-pt-chart-wrap {
	margin: 1.5em 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1em;
}
.iorg-pt-chart-title {
	font-weight: 600;
	margin-bottom: 0.6em;
	color: #14532d;
}
.iorg-pt-chart-canvas-wrap {
	position: relative;
	height: 300px;
}
.iorg-pt-chart {
	max-width: 100%;
}

/* stats badges */
.iorg-pt-stats {
	margin: 1.5em 0;
}
.iorg-pt-stats-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.6em;
}
.iorg-pt-stats-name {
	font-weight: 700;
	font-size: 1.15em;
	color: #14532d;
}
.iorg-pt-stats-meta {
	color: #6b7280;
	font-size: 0.9em;
}
.iorg-pt-stats-grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
	gap: 0.8em;
}
.iorg-pt-stats-card {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	padding: 0.8em 1em;
	text-align: center;
}
.iorg-pt-stats-card.iorg-pt-stats-today {
	background: #dcfce7;
	border-color: #86efac;
}
.iorg-pt-stats-label {
	font-size: 0.8em;
	color: #166534;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.25em;
}
.iorg-pt-stats-value {
	font-size: 1.5em;
	font-weight: 700;
	color: #14532d;
}
.iorg-pt-stats-sub {
	font-size: 0.85em;
	margin-top: 0.25em;
}
.iorg-pt-stats-change-up   { color: #b91c1c; }
.iorg-pt-stats-change-down { color: #15803d; }
.iorg-pt-stats-change-flat { color: #6b7280; }

/* pivot */
.iorg-pt-pivot-wrap {
	margin: 1.5em 0;
}
.iorg-pt-pivot-title {
	font-weight: 600;
	margin-bottom: 0.5em;
	color: #14532d;
}
.iorg-pt-pivot-scroll {
	overflow-x: auto;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fff;
}
.iorg-pt-pivot {
	min-width: 100%;
	border: none;
	font-size: 0.92em;
}
.iorg-pt-pivot th,
.iorg-pt-pivot td {
	white-space: nowrap;
	padding: 0.4em 0.7em;
}
.iorg-pt-pivot .iorg-pt-pivot-rowhead {
	position: sticky;
	left: 0;
	background: #fff;
	text-align: left;
	font-weight: 600;
	color: #14532d;
	border-right: 1px solid #e5e7eb;
}
.iorg-pt-pivot thead .iorg-pt-pivot-rowhead {
	background: #f3f4f6;
}
.iorg-pt-pivot-blank {
	color: #d1d5db;
}
