/* Arsh Tracker — استایل داشبورد مدیریت */

.arsh-wrap {
	--arsh-blue: #2a78d6;
	--arsh-orange: #eb6834;
	--arsh-aqua: #1baf7a;
	--arsh-yellow: #eda100;
	--arsh-ink: #0b0b0b;
	--arsh-muted: #898781;
	--arsh-surface: #ffffff;
	--arsh-plane: #f4f5f7;
	--arsh-border: rgba(11, 11, 11, 0.08);
	font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	max-width: 1200px;
}

.arsh-header {
	margin: 16px 0 10px;
}
.arsh-header h1 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 24px;
	font-weight: 700;
	color: var(--arsh-ink);
}
.arsh-header h1 .dashicons {
	color: var(--arsh-blue);
	font-size: 28px;
	width: 28px;
	height: 28px;
}
.arsh-subtitle {
	color: var(--arsh-muted);
	margin: 4px 0 0;
	font-size: 13px;
}

/* تب‌های دوره */
.arsh-tabs {
	display: flex;
	gap: 6px;
	margin: 14px 0 18px;
	flex-wrap: wrap;
}
.arsh-tab {
	padding: 8px 18px;
	border-radius: 999px;
	background: var(--arsh-surface);
	border: 1px solid var(--arsh-border);
	color: #444;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all .15s ease;
}
.arsh-tab:hover {
	border-color: var(--arsh-blue);
	color: var(--arsh-blue);
}
.arsh-tab.is-active {
	background: var(--arsh-blue);
	border-color: var(--arsh-blue);
	color: #fff;
}

/* نوار تنظیمات (تیک سایت فروشگاهی) */
.arsh-settingsbar {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--arsh-surface);
	border: 1px solid var(--arsh-border);
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 16px;
}
.arsh-switch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}
.arsh-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.arsh-switch__slider {
	position: relative;
	width: 44px;
	height: 24px;
	background: #c3c2b7;
	border-radius: 999px;
	transition: background .2s;
	flex-shrink: 0;
}
.arsh-switch__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s;
}
.arsh-switch input:checked + .arsh-switch__slider { background: #1baf7a; }
.arsh-switch input:checked + .arsh-switch__slider::before { transform: translateX(-20px); }
.arsh-switch__text { display: flex; flex-direction: column; line-height: 1.5; }
.arsh-switch__text b { font-size: 14px; color: var(--arsh-ink); }
.arsh-switch__text small { font-size: 12px; color: var(--arsh-muted); }

/* نوار فیلتر: تب‌ها + بازه دلخواه */
.arsh-filterbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 14px 0 18px;
}
.arsh-filterbar .arsh-tabs {
	margin: 0;
}
.arsh-daterange {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--arsh-surface);
	border: 1px solid var(--arsh-border);
	border-radius: 12px;
	padding: 6px 10px;
}
.arsh-daterange.is-active {
	border-color: var(--arsh-blue);
	box-shadow: 0 0 0 2px rgba(42, 120, 214, .12);
}
.arsh-daterange label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: var(--arsh-muted);
}
.arsh-daterange input[type="date"] {
	border: 1px solid var(--arsh-border);
	border-radius: 7px;
	padding: 4px 8px;
	font-size: 13px;
	background: var(--arsh-plane);
	color: var(--arsh-ink);
}

/* تقویم شمسی */
.arsh-jdate {
	cursor: pointer;
	min-width: 120px;
}
.arsh-jcal {
	position: absolute;
	z-index: 100000;
	width: 240px;
	background: #fff;
	border: 1px solid rgba(11, 11, 11, .12);
	border-radius: 12px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
	padding: 10px;
	font-family: system-ui, Tahoma, sans-serif;
	direction: rtl;
}
.arsh-jcal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;
	color: #0b0b0b;
}
.arsh-jcal__head button {
	border: none;
	background: #f0f0ee;
	border-radius: 7px;
	width: 26px;
	height: 26px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #2a78d6;
}
.arsh-jcal__head button:hover { background: #e2e8f5; }
.arsh-jcal__week {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	margin-bottom: 4px;
}
.arsh-jcal__week span {
	text-align: center;
	font-size: 11px;
	color: #898781;
	padding: 4px 0;
}
.arsh-jcal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}
.arsh-jcal__grid .arsh-jcal__empty { visibility: hidden; }
.arsh-jcal__day {
	border: none;
	background: transparent;
	border-radius: 7px;
	padding: 6px 0;
	font-size: 13px;
	cursor: pointer;
	color: #0b0b0b;
}
.arsh-jcal__day:hover { background: #eaf1fb; }
.arsh-jcal__day.is-sel {
	background: #2a78d6;
	color: #fff;
	font-weight: 700;
}

@media (prefers-color-scheme: dark) {
	.arsh-jcal { background: #26262a; border-color: rgba(255, 255, 255, .12); }
	.arsh-jcal__head { color: #e6e6e6; }
	.arsh-jcal__head button { background: #34343a; }
	.arsh-jcal__day { color: #e6e6e6; }
	.arsh-jcal__day:hover { background: #2f3b52; }
}

/* کارت‌های خلاصه */
.arsh-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 18px;
}
.arsh-cards--2 {
	grid-template-columns: repeat(2, 1fr);
	max-width: 620px;
}
.arsh-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--arsh-surface);
	border: 1px solid var(--arsh-border);
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.arsh-card__icon {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
}
.arsh-card__icon .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}
.arsh-card--leads .arsh-card__icon { background: #4a3aa7; }
.arsh-card--today .arsh-card__icon { background: var(--arsh-blue); }
.arsh-card--week .arsh-card__icon { background: var(--arsh-aqua); }
.arsh-card--month .arsh-card__icon { background: var(--arsh-orange); }
.arsh-card--numbers .arsh-card__icon { background: var(--arsh-yellow); }
.arsh-card__hint {
	font-size: 11px;
	color: var(--arsh-muted);
	margin-top: 2px;
}
.arsh-card__body {
	display: flex;
	flex-direction: column;
}
.arsh-card__label {
	font-size: 13px;
	color: var(--arsh-muted);
}
.arsh-card__value {
	font-size: 28px;
	font-weight: 700;
	color: var(--arsh-ink);
	line-height: 1.2;
}

/* شبکه پنل‌ها */
.arsh-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}
.arsh-panel {
	background: var(--arsh-surface);
	border: 1px solid var(--arsh-border);
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
	min-width: 0;
}
.arsh-panel--wide {
	grid-column: 1 / -1;
}
.arsh-panel__title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 14px;
	color: var(--arsh-ink);
	display: flex;
	align-items: center;
	gap: 6px;
}
.arsh-panel__title small {
	font-weight: 400;
	color: var(--arsh-muted);
	font-size: 12px;
}
.arsh-panel canvas {
	width: 100% !important;
	max-width: 100%;
}

/* لجند نمودار */
.arsh-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin-top: 14px;
	justify-content: center;
}
.arsh-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #555;
}
.arsh-legend__item i {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

/* جدول‌ها */
.arsh-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.arsh-table th,
.arsh-table td {
	text-align: right;
	padding: 10px 12px;
	border-bottom: 1px solid var(--arsh-border);
	vertical-align: middle;
}
.arsh-table th {
	color: var(--arsh-muted);
	font-weight: 600;
	font-size: 12px;
	background: var(--arsh-plane);
}
.arsh-table tbody tr:hover,
.arsh-table tr:hover {
	background: rgba(42, 120, 214, .03);
}
.arsh-table a {
	color: var(--arsh-blue);
	text-decoration: none;
}
.arsh-table a:hover {
	text-decoration: underline;
}
.arsh-muted { color: var(--arsh-muted); }
.arsh-badge {
	display: inline-block;
	min-width: 28px;
	text-align: center;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(42, 120, 214, .1);
	color: var(--arsh-blue);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.arsh-empty {
	text-align: center;
	color: var(--arsh-muted);
	padding: 20px;
	font-size: 13px;
}

/* تگ نوع رویداد */
.arsh-tag {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
}
.arsh-tag--call { background: rgba(42, 120, 214, .12); color: #2a78d6; }
.arsh-tag--form { background: rgba(27, 175, 122, .14); color: #128a5f; }

.arsh-more {
	margin: 20px 0;
}

/* لینک‌ساز UTM */
.arsh-utm-form label {
	display: block;
	margin-bottom: 12px;
}
.arsh-utm-form label > span {
	display: block;
	font-size: 13px;
	color: var(--arsh-ink);
	margin-bottom: 5px;
	font-weight: 500;
}
.arsh-utm-form label b { color: #d03b3b; }
.arsh-utm-form input[type="text"],
.arsh-utm-form input[type="url"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--arsh-border);
	border-radius: 8px;
	background: var(--arsh-plane);
	font-size: 13px;
	color: var(--arsh-ink);
}
.arsh-utm-form input:focus {
	outline: none;
	border-color: var(--arsh-blue);
	box-shadow: 0 0 0 2px rgba(42, 120, 214, .15);
}
.arsh-utm-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0 14px;
}
.arsh-utm-output {
	margin-top: 8px;
	padding: 14px;
	background: var(--arsh-plane);
	border-radius: 10px;
}
.arsh-utm-output textarea {
	width: 100%;
	border: 1px solid var(--arsh-border);
	border-radius: 8px;
	padding: 10px 12px;
	font-family: monospace;
	font-size: 13px;
	resize: vertical;
	background: var(--arsh-surface);
	color: var(--arsh-blue);
}
.arsh-utm-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}
.arsh-utm-copied {
	color: #128a5f;
	font-size: 13px;
	font-weight: 600;
}
.arsh-utm-save {
	margin-top: 14px;
}
.arsh-sep {
	margin: 28px 0 18px;
	border: none;
	border-top: 1px solid var(--arsh-border);
}
.arsh-section-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--arsh-ink);
	margin: 0 0 6px;
}
.arsh-del {
	color: #b32d2e !important;
	text-decoration: none !important;
	font-weight: 700;
	cursor: pointer;
}

/* tooltip نمودار */
.arsh-chart-tooltip {
	position: fixed;
	z-index: 99999;
	background: rgba(17, 17, 17, .92);
	color: #fff;
	padding: 7px 11px;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1.5;
	pointer-events: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
	white-space: nowrap;
	font-family: system-ui, sans-serif;
	direction: rtl;
}

.arsh-footer {
	margin: 24px 0;
}
.arsh-reset {
	color: #b32d2e !important;
	border-color: #b32d2e !important;
}

/* واکنش‌گرا */
@media (max-width: 960px) {
	.arsh-cards { grid-template-columns: repeat(2, 1fr); }
	.arsh-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.arsh-cards { grid-template-columns: 1fr; }
}

/* حالت تیره */
@media (prefers-color-scheme: dark) {
	.arsh-wrap {
		--arsh-ink: #e6e6e6;
		--arsh-muted: #9a9a94;
		--arsh-surface: #26262a;
		--arsh-plane: #1e1e22;
		--arsh-border: rgba(255, 255, 255, 0.08);
	}
	.arsh-table a { color: #6ba6ee; }
}
