/* ===== Silver & Gold Price Pro - Front & Admin Styles ===== */

:root {
	--sgp-navy-900: #10173a;
	--sgp-navy-800: #1a2456;
	--sgp-navy-700: #212c62;
	--sgp-navy-600: #2b3874;
	--sgp-blue-accent: #3b63f0;
	--sgp-blue-soft: rgba(59, 99, 240, 0.14);
	--sgp-gold-start: #f4d488;
	--sgp-gold-end: #c9992f;
	--sgp-green: #22c55e;
	--sgp-red: #ef4444;
	--sgp-white: #ffffff;
	--sgp-text-muted-dark: rgba(255, 255, 255, 0.55);
	--sgp-border-dark: rgba(255, 255, 255, 0.08);
	--sgp-row-alt: rgba(255, 255, 255, 0.03);
}

.sgp-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	direction: rtl;
	margin: 20px 0;
}

.sgp-card {
	background: #ffffff;
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 2px 10px rgba(16, 23, 58, 0.06);
	border: 1px solid #e8ebf5;
	border-top: 3px solid var(--sgp-blue-accent);
	transition: transform .15s ease, box-shadow .15s ease;
	direction: rtl;
	text-align: right;
	font-family: inherit;
}

.sgp-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 22px rgba(16, 23, 58, 0.12);
}

.sgp-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.sgp-card-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--sgp-navy-800);
}

.sgp-card-price {
	font-size: 26px;
	font-weight: 800;
	color: var(--sgp-navy-900);
	line-height: 1.3;
}

.sgp-card-price .sgp-unit {
	font-size: 13px;
	font-weight: 500;
	color: #8890ac;
	margin-right: 6px;
}

.sgp-card-footer {
	margin-top: 10px;
	font-size: 11px;
	color: #9aa1bd;
}

.sgp-badge {
	display: inline-block;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--sgp-blue-soft);
	color: var(--sgp-blue-accent);
}

.sgp-badge-warning {
	background: #fff3cd;
	color: #8a6300;
}

.sgp-badge-success {
	background: #d4f7dc;
	color: #157347;
}

.sgp-error {
	color: #b91c1c;
	padding: 10px;
	background: #fee2e2;
	border-radius: 8px;
	direction: rtl;
}

.sgp-change-arrow {
	display: inline-block;
	font-size: 9px;
	margin-right: 4px;
	vertical-align: middle;
}

.sgp-change-up {
	color: var(--sgp-green);
}

.sgp-change-down {
	color: var(--sgp-red);
}

@keyframes sgp-row-flash-anim {
	0%   { background-color: rgba(59, 99, 240, 0.35); }
	100% { background-color: transparent; }
}

.sgp-row-flash {
	animation: sgp-row-flash-anim 1.6s ease-out;
}

.sgp-order-list {
	max-width: 420px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 6px;
	margin: 0 0 16px;
	list-style: none;
}

.sgp-order-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	margin-bottom: 6px;
	font-size: 13px;
	direction: rtl;
	text-align: right;
}

.sgp-order-item:last-child {
	margin-bottom: 0;
}

.sgp-order-handle {
	cursor: move;
	color: #a7aaad;
	font-size: 16px;
}

.sgp-order-item.ui-sortable-helper {
	box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.sgp-contact-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
	padding: 12px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--sgp-gold-start), var(--sgp-gold-end));
	color: #3a2c05;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	transition: opacity .15s ease;
}

.sgp-contact-btn:hover {
	opacity: 0.9;
	color: #3a2c05;
}

/* ===== Real Price Table (dark navy, matches site palette) ===== */

.sgp-table-wrap {
	max-width: 520px;
	background: linear-gradient(160deg, var(--sgp-navy-800) 0%, var(--sgp-navy-900) 100%);
	border-radius: 18px;
	padding: 18px 18px 14px;
	box-shadow: 0 10px 30px rgba(16, 23, 58, 0.25);
	font-family: inherit;
	direction: rtl;
}

.sgp-table-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 2px 14px;
	border-bottom: 1px solid var(--sgp-border-dark);
	margin-bottom: 4px;
}

.sgp-table-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--sgp-white);
}

.sgp-live-indicator {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--sgp-green);
	background: rgba(34, 197, 94, 0.12);
	padding: 4px 10px;
	border-radius: 999px;
}

.sgp-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sgp-green);
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
	animation: sgp-pulse 1.8s infinite;
}

@keyframes sgp-pulse {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
	70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sgp-table-scroll {
	overflow-x: auto;
}

.sgp-price-table {
	width: 100%;
	border-collapse: collapse;
}

.sgp-price-table thead th {
	text-align: right;
	font-size: 11px;
	font-weight: 500;
	color: var(--sgp-text-muted-dark);
	padding: 10px 6px;
	text-transform: none;
}

.sgp-price-table thead th.sgp-th-price {
	text-align: center;
	width: 27%;
}

.sgp-price-table thead th.sgp-th-name {
	width: 46%;
}

.sgp-price-table tbody tr.sgp-row {
	border-top: 1px solid var(--sgp-border-dark);
	transition: background-color .15s ease;
}

.sgp-price-table tbody tr.sgp-row:nth-child(even) {
	background: var(--sgp-row-alt);
}

.sgp-price-table tbody tr.sgp-row:hover {
	background: rgba(59, 99, 240, 0.08);
}

.sgp-price-table td {
	padding: 12px 6px;
	vertical-align: middle;
}

.sgp-td-name {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sgp-item-badge {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10.5px;
	font-weight: 700;
	color: var(--sgp-white);
}

.sgp-badge-silver {
	background: linear-gradient(135deg, #cfd6e8, #8891b0);
	color: var(--sgp-navy-900);
}

.sgp-badge-ag {
	background: linear-gradient(135deg, #aab3cf, #6c7597);
	color: var(--sgp-white);
}

.sgp-badge-gold {
	background: linear-gradient(135deg, var(--sgp-gold-start), var(--sgp-gold-end));
	color: #4a3707;
}

.sgp-badge-usdt {
	background: linear-gradient(135deg, #6c8dff, var(--sgp-blue-accent));
	color: var(--sgp-white);
}

.sgp-badge-default {
	background: var(--sgp-navy-600);
}

.sgp-item-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sgp-item-label {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--sgp-white);
}

.sgp-item-sub {
	font-size: 10.5px;
	color: var(--sgp-text-muted-dark);
}

.sgp-item-sub-warning {
	color: #f5c451;
}

.sgp-td-price {
	text-align: center;
	white-space: nowrap;
}

.sgp-price-value {
	font-size: 14px;
	font-weight: 800;
	color: var(--sgp-white);
	direction: ltr;
	display: inline-block;
}

.sgp-price-unit {
	display: block;
	font-size: 10.5px;
	color: var(--sgp-text-muted-dark);
	margin-top: 1px;
}

.sgp-table-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--sgp-border-dark);
	font-size: 11px;
	color: var(--sgp-text-muted-dark);
}

.sgp-table-footer .sgp-clock-icon {
	display: inline-flex;
}

.sgp-relative-time {
	direction: rtl;
	unicode-bidi: isolate;
}

@media (max-width: 480px) {
	.sgp-table-wrap {
		max-width: 100%;
		border-radius: 14px;
		padding: 14px 12px 10px;
	}
	.sgp-item-label {
		font-size: 12.5px;
	}
	.sgp-price-value {
		font-size: 14px;
	}
}

/* ===== Calculator ===== */

.sgp-calculator {
	max-width: 420px;
	background: #fff;
	border: 1px solid #e8ebf5;
	border-radius: 16px;
	padding: 22px;
	box-shadow: 0 2px 12px rgba(16, 23, 58, 0.06);
	direction: rtl;
	text-align: right;
	font-family: inherit;
}

.sgp-calc-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 12px;
	color: var(--sgp-navy-900);
}

.sgp-calc-current-price {
	background: var(--sgp-blue-soft);
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--sgp-navy-700);
	margin-bottom: 16px;
}

.sgp-calc-current-price strong {
	font-size: 16px;
	color: var(--sgp-navy-900);
	margin: 0 4px;
}

.sgp-calc-row {
	margin-bottom: 10px;
}

.sgp-calc-row label {
	display: block;
	font-size: 13px;
	color: #555;
	margin-bottom: 6px;
}

.sgp-calc-input {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #dfe2e6;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color .15s ease;
}

.sgp-calc-input:focus {
	outline: none;
	border-color: var(--sgp-blue-accent);
	box-shadow: 0 0 0 3px var(--sgp-blue-soft);
}

.sgp-calc-swap {
	text-align: center;
	font-size: 20px;
	color: var(--sgp-blue-accent);
	margin: 4px 0;
}

.sgp-calc-note {
	margin-top: 12px;
	font-size: 12px;
	color: #999;
}

/* ===== Admin ===== */

.sgp-admin-wrap .sgp-dashboard-toolbar {
	margin: 16px 0;
	display: flex;
	align-items: center;
	gap: 12px;
}

.sgp-dashboard-table {
	margin-top: 10px;
}

.sgp-sources-table {
	margin-bottom: 24px;
}

.sgp-help-box code {
	display: inline-block;
	background: #f3f4f6;
	padding: 6px 10px;
	border-radius: 6px;
	margin: 4px 0;
}

.sgp-metals-table input[type="text"],
.sgp-metals-table input[type="number"] {
	width: 100%;
	min-width: 70px;
}

.sgp-add-item-form th {
	width: 240px;
}

.sgp-test-source-result {
	margin-right: 10px;
	font-size: 13px;
	vertical-align: middle;
}

.sgp-test-source-result.success {
	color: #157347;
	font-weight: 600;
}

.sgp-test-source-result.error {
	color: #b91c1c;
	font-weight: 600;
}

.button-link-delete.sgp-remove-item-link {
	color: #b91c1c;
	text-decoration: none;
}

.button-link-delete.sgp-remove-item-link:hover {
	color: #7a1313;
	text-decoration: underline;
}

.sgp-field-inactive {
	opacity: 0.45;
}

@media (max-width: 480px) {
	.sgp-card-price {
		font-size: 22px;
	}
	.sgp-calculator {
		padding: 16px;
	}
}

/* ===== نمودار روند قیمت (شورتکد sgp_price_chart) ===== */
.sgp-chart-wrap {
	background: linear-gradient(160deg, var(--sgp-navy-800) 0%, var(--sgp-navy-900) 100%);
	border-radius: 14px;
	padding: 16px 18px 12px;
	direction: rtl;
	box-shadow: 0 8px 24px rgba(16, 23, 58, 0.18);
}

.sgp-chart-title {
	color: var(--sgp-white);
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 10px;
}

.sgp-chart-canvas-holder {
	position: relative;
	width: 100%;
}

.sgp-chart-canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.sgp-chart-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sgp-text-muted-dark);
	font-size: 12px;
}

/* ===== پیش‌نمایش قالب‌های آماده تصویر تلگرام (ادمین) ===== */
.sgp-template-options {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.sgp-template-option {
	border: 2px solid #e2e4ea;
	border-radius: 10px;
	padding: 10px;
	width: 150px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease;
}

.sgp-template-option:hover {
	border-color: var(--sgp-blue-accent);
}

.sgp-template-option input {
	margin-left: 6px;
}

.sgp-template-option .sgp-template-swatch {
	display: block;
	height: 70px;
	border-radius: 6px;
	margin-bottom: 8px;
	background: linear-gradient(160deg, var(--sgp-navy-800) 0%, var(--sgp-navy-900) 100%);
}

.sgp-template-swatch.sgp-swatch-cards {
	background: repeating-linear-gradient(
		to bottom,
		var(--sgp-navy-800) 0px,
		var(--sgp-navy-800) 14px,
		var(--sgp-navy-700) 15px,
		var(--sgp-navy-700) 22px
	);
}

.sgp-template-swatch.sgp-swatch-story {
	background: linear-gradient(180deg, var(--sgp-navy-800) 0%, var(--sgp-navy-900) 100%);
	height: 90px;
}

@media (max-width: 480px) {
	.sgp-template-option {
		width: 100%;
	}
}
