/**
 * PCTech Affiliate — Premium Enterprise Dashboard
 * Compatible with:
 *   - shortcode-affiliate-dashboard.php
 *   - affiliate-assets.php
 *
 * Design direction:
 *   Enterprise SaaS / Fintech / Corporate Partner Portal
 *   Navy PCTech + controlled orange accent
 *
 * IMPORTANT:
 *   This file intentionally targets the existing PHP class/id names.
 *   No PHP markup or JavaScript IDs are required to change.
 */

.pctech-aff-dashboard {
	--aff-navy: #09213f;
	--aff-navy-2: #102f55;
	--aff-orange: #ee8500;
	--aff-orange-dark: #d97000;
	--aff-ink: #14263d;
	--aff-muted: #6b7b90;
	--aff-soft: #f4f7fb;
	--aff-border: #e5ebf2;
	--aff-white: #ffffff;
	--aff-success: #16845b;
	--aff-danger: #c73b3b;
	--aff-shadow: 0 10px 35px rgba(9, 33, 63, .07);
	--aff-shadow-hover: 0 16px 45px rgba(9, 33, 63, .12);
	--aff-radius: 18px;
	--aff-radius-sm: 12px;

	box-sizing: border-box;
	width: 100%;
	max-width: 1480px;
	margin: 32px auto 64px;
	padding: 0 28px;
	color: var(--aff-ink);
	font-family: inherit;
}

.pctech-aff-dashboard *,
.pctech-aff-dashboard *::before,
.pctech-aff-dashboard *::after {
	box-sizing: border-box;
}

/* =========================
   Dashboard shell / header
   ========================= */

.pctech-aff-dashboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 26px;
	padding: 0 2px;
}

.pctech-aff-dashboard-header h1 {
	margin: 0 0 7px;
	color: var(--aff-navy);
	font-size: clamp(26px, 2.3vw, 36px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.035em;
}

.pctech-aff-header-sub {
	margin: 0;
	color: var(--aff-muted);
	font-size: 14px;
	line-height: 1.6;
}

.pctech-aff-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* 2026-09-10: chip "So du kha dung" tren header dashboard doi tac - xem
inc/shortcode-affiliate-dashboard.php ($wallet['available']). */
.pctech-aff-header-balance {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	background: linear-gradient(135deg, #fff7ed, #fff);
	border: 1px solid #fde1b8;
	cursor: pointer;
	transition: box-shadow .15s ease, transform .15s ease;
}

.pctech-aff-header-balance:hover {
	box-shadow: var(--aff-shadow);
	transform: translateY(-1px);
}

.pctech-aff-header-balance-icon {
	font-size: 18px;
	line-height: 1;
}

.pctech-aff-header-balance-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.pctech-aff-header-balance-label {
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: .3px;
	color: var(--aff-muted);
	font-weight: 700;
}

.pctech-aff-header-balance-value {
	font-size: 15px;
	font-weight: 800;
	color: var(--aff-orange-dark);
}

/* 2026-09-10: chip chuyen sang che do "Dung so du tra don nay" khi dang
xem 1 don chua thanh toan cua chinh minh (phien elevated) - xem
$chip_pay_code trong inc/shortcode-affiliate-dashboard.php. */
.pctech-aff-header-balance-payable {
	background: linear-gradient(135deg, #16A34A, #15803D);
	border-color: #15803D;
}

.pctech-aff-header-balance-payable .pctech-aff-header-balance-label,
.pctech-aff-header-balance-payable .pctech-aff-header-balance-value {
	color: #fff;
}

.pctech-aff-header-balance-loading {
	opacity: .7;
	pointer-events: none;
}

@media (max-width: 640px) {
	.pctech-aff-header-balance-label {
		display: none;
	}

	.pctech-aff-header-balance {
		padding: 7px 10px;
	}
}

.pctech-aff-avatar {
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	flex: 0 0 48px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: linear-gradient(145deg, var(--aff-navy), #1d4e80);
	color: #fff;
	box-shadow: 0 6px 20px rgba(9, 33, 63, .16);
	font-size: 16px;
	font-weight: 800;
}

.pctech-aff-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid rgba(9, 33, 63, .22);
	border-radius: 11px;
	background: #fff;
	color: var(--aff-navy);
	font-size: 13px;
	font-weight: 750;
	text-decoration: none;
	transition: .22s ease;
}

.pctech-aff-btn-secondary:hover {
	border-color: var(--aff-navy);
	background: var(--aff-navy);
	color: #fff;
	transform: translateY(-1px);
}

.pctech-aff-dashboard .btn.btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 21px;
	border: 0;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--aff-orange), #f39a19);
	color: #fff;
	box-shadow: 0 9px 22px rgba(238, 133, 0, .20);
	font-weight: 750;
	text-decoration: none;
	transition: .22s ease;
}

.pctech-aff-dashboard .btn.btn-primary:hover {
	background: linear-gradient(135deg, var(--aff-orange-dark), var(--aff-orange));
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 13px 28px rgba(238, 133, 0, .27);
}

/* =========================
   Main layout / sidebar
   ========================= */

.pctech-aff-dashboard-layout {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.pctech-aff-sidebar {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 16px 12px 14px;
	border: 1px solid rgba(9, 33, 63, .07);
	border-radius: 20px;
	background: rgba(255, 255, 255, .96);
	box-shadow: var(--aff-shadow);
}

.pctech-aff-sidebar::before {
	content: "PCTECH  ·  PARTNER";
	display: block;
	padding: 8px 12px 18px;
	border-bottom: 1px solid var(--aff-border);
	color: var(--aff-navy);
	font-size: 14px;
	font-weight: 850;
	letter-spacing: .10em;
}

.pctech-aff-sidebar-item {
	width: 100%;
	min-height: 47px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 13px;
	border: 1px solid transparent;
	border-radius: 11px;
	background: transparent;
	color: #53677f;
	font: inherit;
	font-size: 14px;
	font-weight: 650;
	text-align: left;
	cursor: pointer;
	transition: .2s ease;
}

.pctech-aff-sidebar-item:hover {
	background: #f5f8fc;
	color: var(--aff-navy);
	transform: translateX(2px);
}

.pctech-aff-sidebar-item.pctech-aff-active {
	background: linear-gradient(135deg, var(--aff-navy), #123a68);
	color: #fff;
	box-shadow: 0 8px 20px rgba(9, 33, 63, .16);
}

.pctech-aff-sidebar-icon {
	width: 28px;
	display: inline-flex;
	justify-content: center;
	font-size: 16px;
	filter: saturate(.82);
}

.pctech-aff-sidebar-promo {
	position: relative;
	overflow: hidden;
	margin: 18px 1px 0;
	padding: 20px 17px;
	border-radius: 16px;
	background:
		radial-gradient(circle at 85% 12%, rgba(238, 133, 0, .22), transparent 32%),
		linear-gradient(150deg, #071c36, #0e3157);
	color: #fff;
	box-shadow: 0 14px 30px rgba(9, 33, 63, .20);
}

.pctech-aff-sidebar-promo::after {
	content: "";
	position: absolute;
	width: 110px;
	height: 110px;
	right: -55px;
	bottom: -55px;
	border: 1px solid rgba(255,255,255,.10);
	border-radius: 50%;
}

.pctech-aff-sidebar-promo-icon {
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	margin-bottom: 13px;
	border: 1px solid rgba(255,255,255,.18);
	border-radius: 12px;
	background: rgba(255,255,255,.07);
	font-size: 20px;
}

.pctech-aff-sidebar-promo strong {
	display: block;
	margin-bottom: 7px;
	font-size: 14px;
}

.pctech-aff-sidebar-promo p {
	margin: 0 0 15px;
	color: rgba(255,255,255,.72);
	font-size: 12px;
	line-height: 1.55;
}

.pctech-aff-sidebar-promo-btn {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 12px;
	border: 1px solid rgba(255,255,255,.28);
	border-radius: 9px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}

/* =========================
   Content / panels
   ========================= */

.pctech-aff-tab-content {
	min-width: 0;
}

.pctech-aff-tab-panel[hidden] {
	display: none !important;
}

.pctech-aff-tab-panel > h2 {
	margin: 30px 0 13px;
	color: var(--aff-navy);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -.02em;
}

.pctech-aff-tab-panel > h2:first-child {
	margin-top: 0;
}

.pctech-aff-card {
	min-width: 0;
	padding: 23px;
	border: 1px solid rgba(9, 33, 63, .065);
	border-radius: var(--aff-radius);
	background: #fff;
	box-shadow: var(--aff-shadow);
	transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}

.pctech-aff-card:hover {
	border-color: rgba(9, 33, 63, .10);
	box-shadow: var(--aff-shadow-hover);
}

.pctech-aff-card-title {
	margin: 0 0 17px;
	color: var(--aff-navy);
	font-size: 13px;
	font-weight: 850;
	letter-spacing: .055em;
	text-transform: uppercase;
}

.pctech-aff-link-qr-row {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(330px, .9fr);
	gap: 18px;
	margin-bottom: 18px;
}

.pctech-aff-referral-box {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
	margin: 0 0 15px;
	padding: 0;
	background: transparent;
	box-shadow: none;
}

.pctech-aff-referral-box input {
	width: 100%;
	min-width: 0;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--aff-border);
	border-radius: 11px;
	background: #f8fafc;
	color: #344a64;
	font-size: 13px;
	box-shadow: inset 0 1px 1px rgba(9,33,63,.02);
}

.pctech-aff-share-label {
	display: inline-block;
	margin: 0 10px 0 0;
	color: var(--aff-muted);
	font-size: 12px;
	font-weight: 650;
	vertical-align: middle;
}

.pctech-aff-share-icons {
	display: inline-flex;
	gap: 7px;
	vertical-align: middle;
}

.pctech-aff-share-btn {
	width: 34px;
	height: 34px;
	display: inline-grid;
	place-items: center;
	border: 0 !important;
	border-radius: 50% !important;
	color: #fff !important;
	font-size: 12px;
	font-weight: 800;
	text-decoration: none !important;
	box-shadow: 0 5px 13px rgba(9,33,63,.12);
	transition: .2s ease;
}

.pctech-aff-share-btn:hover {
	transform: translateY(-2px) scale(1.04);
	filter: brightness(1.04);
}

.pctech-aff-qr-box {
	min-height: 150px;
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.pctech-aff-qr-box canvas,
.pctech-aff-qr-box img {
	width: 132px !important;
	height: 132px !important;
	max-width: 132px;
	flex: 0 0 132px;
	border: 7px solid #fff;
	border-radius: 10px;
	box-shadow: 0 7px 22px rgba(9,33,63,.10);
}

.pctech-aff-qr-box p {
	line-height: 1.55;
}

.pctech-aff-qr-box > div:last-child {
	min-width: 0;
}

/* =========================
   KPI cards
   ========================= */

.pctech-aff-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 15px;
	margin: 0 0 20px;
}

.pctech-aff-stat-card {
	position: relative;
	min-width: 0;
	min-height: 126px;
	display: grid;
	grid-template-columns: 45px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 13px;
	align-items: center;
	padding: 20px;
	border: 1px solid rgba(9,33,63,.06);
	border-radius: 16px;
	background: #fff;
	box-shadow: var(--aff-shadow);
	overflow: hidden;
}

.pctech-aff-stat-card::after {
	content: "";
	position: absolute;
	right: -24px;
	bottom: -32px;
	width: 90px;
	height: 90px;
	border: 1px solid rgba(9,33,63,.045);
	border-radius: 50%;
}

.pctech-aff-stat-icon {
	grid-row: 1 / span 2;
	width: 45px;
	height: 45px;
	display: grid;
	place-items: center;
	border-radius: 13px !important;
	font-size: 18px;
}

.pctech-aff-stat-card .label {
	margin: 0 0 3px;
	color: var(--aff-muted);
	font-size: 12px;
	font-weight: 600;
}

.pctech-aff-stat-card .value {
	color: var(--aff-navy);
	font-size: clamp(20px, 2vw, 25px);
	font-weight: 850;
	line-height: 1.1;
	letter-spacing: -.025em;
}

.pctech-aff-stat-card.highlight {
	border-color: rgba(238,133,0,.14);
	background: linear-gradient(145deg, #fff, #fffaf4);
}

.pctech-aff-stat-card.highlight .value {
	color: var(--aff-orange);
}

/* =========================
   Analytics / recent
   ========================= */

.pctech-aff-chart-recent-row {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(330px, .85fr);
	gap: 18px;
	margin-bottom: 24px;
}

.pctech-aff-chart-card {
	min-height: 405px;
}

.pctech-aff-chart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.pctech-aff-chart-header .pctech-aff-card-title {
	margin: 0;
}

.pctech-aff-chart-header select,
.pctech-aff-dashboard select {
	height: 38px;
	padding: 0 34px 0 12px;
	border: 1px solid var(--aff-border);
	border-radius: 9px;
	background: #fff;
	color: var(--aff-navy);
	font: inherit;
	font-size: 12px;
	font-weight: 650;
}

#pctech-aff-chart-canvas {
	width: 100% !important;
	max-height: 205px;
	margin: 5px 0 12px;
}

.pctech-aff-chart-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 8px;
}

.pctech-aff-chart-metrics > div {
	padding: 13px 14px;
	border: 1px solid var(--aff-border);
	border-radius: 11px;
	background: #fbfcfe;
}

.pctech-aff-chart-metrics .label {
	margin-bottom: 4px;
	color: var(--aff-muted);
	font-size: 11px;
}

.pctech-aff-chart-metrics .value {
	color: var(--aff-navy);
	font-size: 16px;
	font-weight: 800;
}

.pctech-aff-chart-metrics .change {
	min-height: 16px;
	margin-top: 3px;
	font-size: 11px;
	font-weight: 700;
}

.pctech-aff-empty-state {
	min-height: 260px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 25px;
	text-align: center;
}

.pctech-aff-empty-icon {
	width: 68px;
	height: 68px;
	display: grid;
	place-items: center;
	margin-bottom: 14px;
	border-radius: 20px;
	background: #f4f7fb;
	color: #7c8da3;
	font-size: 27px;
}

.pctech-aff-empty-state strong {
	color: var(--aff-navy);
	font-size: 15px;
}

.pctech-aff-empty-state p {
	max-width: 280px;
	margin: 7px auto 0;
	color: var(--aff-muted);
	font-size: 12.5px;
	line-height: 1.6;
}

/* =========================
   Tables
   ========================= */

.pctech-aff-dashboard table {
	width: 100%;
	margin: 0 0 24px;
	border: 1px solid var(--aff-border);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 15px;
	background: #fff;
	box-shadow: 0 7px 24px rgba(9,33,63,.045);
	overflow: hidden;
}

.pctech-aff-dashboard table th,
.pctech-aff-dashboard table td {
	padding: 14px 15px;
	border-bottom: 1px solid #edf1f5;
	color: #43566d;
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
	vertical-align: middle;
}

.pctech-aff-dashboard table th {
	background: #f8fafc;
	color: #5a6d84;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .045em;
	text-transform: uppercase;
}

.pctech-aff-dashboard table tbody tr {
	transition: background .16s ease;
}

.pctech-aff-dashboard table tbody tr:hover {
	background: #fbfcfe;
}

.pctech-aff-dashboard table tbody tr:last-child td {
	border-bottom: 0;
}

.pctech-aff-dashboard table code {
	padding: 4px 7px;
	border-radius: 6px;
	background: #f3f6fa;
	color: var(--aff-navy);
	font-size: 12px;
	font-weight: 700;
}

/* =========================
   Forms / account / customer
   ========================= */

.pctech-aff-field {
	margin-bottom: 17px;
}

.pctech-aff-field label {
	display: block;
	margin-bottom: 7px;
	color: var(--aff-navy);
	font-size: 12.5px;
	font-weight: 700;
}

.pctech-aff-field input[type="text"],
.pctech-aff-field input[type="tel"],
.pctech-aff-field input[type="email"],
.pctech-aff-field input[type="password"],
.pctech-aff-field input[type="number"],
.pctech-aff-field textarea,
.pctech-aff-field select,
#pctech-aff-withdraw-amount,
#pctech-aff-dashboard input[type="text"],
#pctech-aff-dashboard input[type="email"] {
	width: 100%;
	min-height: 45px;
	padding: 10px 13px;
	border: 1px solid #dfe6ee;
	border-radius: 10px;
	background: #fff;
	color: var(--aff-ink);
	font: inherit;
	font-size: 13px;
	transition: .18s ease;
}

.pctech-aff-field input:focus,
.pctech-aff-field textarea:focus,
.pctech-aff-field select:focus {
	outline: none;
	border-color: rgba(238,133,0,.70);
	box-shadow: 0 0 0 4px rgba(238,133,0,.09);
}

.pctech-aff-field textarea {
	min-height: 92px;
	resize: vertical;
}

.pctech-aff-error {
	margin: 7px 0;
	color: var(--aff-danger) !important;
	font-size: 12.5px;
	font-weight: 600;
}

.pctech-aff-success {
	margin: 7px 0;
	color: var(--aff-success) !important;
	font-size: 12.5px;
	font-weight: 600;
}

.pctech-aff-bank-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	margin: 0 0 18px;
	padding: 17px 18px;
	border: 1px solid #dfe8e4;
	border-radius: 13px;
	background: #f7fcfa;
}

.pctech-aff-bank-summary p {
	color: #496457;
	font-size: 13px;
}

.pctech-aff-ob-results {
	border: 1px solid var(--aff-border);
	border-radius: 11px;
	background: #fff;
	box-shadow: 0 12px 30px rgba(9,33,63,.10);
}

.pctech-aff-ob-result-row {
	padding: 11px 13px;
	border-bottom: 1px solid #edf1f5;
	cursor: pointer;
	transition: background .15s ease;
}

.pctech-aff-ob-result-row:hover {
	background: #f7f9fc;
}

.pctech-aff-ob-qty-input,
.pctech-aff-ob-svc-qty-input {
	width: 70px !important;
	min-height: 36px !important;
	padding: 6px 9px !important;
	border-radius: 8px !important;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1180px) {
	.pctech-aff-dashboard {
		padding: 0 20px;
	}

	.pctech-aff-dashboard-layout {
		grid-template-columns: 215px minmax(0, 1fr);
	}

	.pctech-aff-stat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pctech-aff-link-qr-row,
	.pctech-aff-chart-recent-row {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 820px) {
	.pctech-aff-dashboard {
		margin-top: 22px;
		padding: 0 14px;
	}

	.pctech-aff-dashboard-header {
		align-items: flex-start;
	}

	.pctech-aff-dashboard-header h1 {
		font-size: 25px;
	}

	.pctech-aff-header-right {
		flex-wrap: wrap;
		justify-content: flex-end;
	}

	.pctech-aff-dashboard-layout {
		grid-template-columns: 1fr;
	}

	.pctech-aff-sidebar {
		position: static;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
		padding: 10px;
	}

	.pctech-aff-sidebar::before,
	.pctech-aff-sidebar-promo {
		display: none;
	}

	.pctech-aff-sidebar-item {
		justify-content: center;
		padding: 0 7px;
		font-size: 12px;
	}

	.pctech-aff-sidebar-icon {
		width: auto;
	}

	.pctech-aff-card {
		padding: 19px;
	}

	.pctech-aff-qr-box {
		align-items: flex-start;
	}
}

@media (max-width: 560px) {
	.pctech-aff-dashboard {
		padding: 0 10px;
	}

	.pctech-aff-dashboard-header {
		display: block;
	}

	.pctech-aff-header-right {
		justify-content: flex-start;
		margin-top: 14px;
	}

	.pctech-aff-sidebar {
		grid-template-columns: repeat(2, 1fr);
	}

	.pctech-aff-stat-grid {
		grid-template-columns: 1fr;
	}

	.pctech-aff-referral-box {
		grid-template-columns: 1fr;
	}

	.pctech-aff-qr-box {
		flex-direction: column;
	}

	.pctech-aff-chart-metrics {
		grid-template-columns: 1fr;
	}

	.pctech-aff-dashboard table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		white-space: nowrap;
	}

	.pctech-aff-dashboard table th,
	.pctech-aff-dashboard table td {
		padding: 11px 12px;
	}

	.pctech-aff-dashboard .btn.btn-primary,
	.pctech-aff-btn-secondary {
		min-height: 42px;
	}

	.pctech-aff-card-title {
		font-size: 12px;
	}
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
	.pctech-aff-dashboard *,
	.pctech-aff-dashboard *::before,
	.pctech-aff-dashboard *::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
