/* ==========================================================================
   TCG Manager — Dashboard styles
   ========================================================================== */

/* Layout
   ========================================================================== */

.tcg-dashboard-wrap {
	display: flex;
	gap: 0;
	min-height: 600px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

/* Sidebar
   ========================================================================== */

.tcg-dashboard-sidebar {
	width: 240px;
	flex-shrink: 0;
	background: #222;
	color: #ccc;
}

.tcg-sidebar-header {
	padding: 20px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tcg-shop-name {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	display: block;
}

.tcg-nav-menu {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.tcg-nav-item {
	margin: 0;
}

.tcg-nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	color: #aab;
	text-decoration: none;
	font-size: 14px;
	transition: background 0.15s, color 0.15s;
}

.tcg-nav-link:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

.tcg-nav-link.active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-weight: 600;
}

.tcg-nav-icon {
	font-size: 18px;
	width: 20px;
	text-align: center;
}

.tcg-nav-divider {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 8px;
	padding-top: 8px;
}

.tcg-nav-logout {
	margin-top: 0;
}

/* Content area
   ========================================================================== */

.tcg-dashboard-content {
	flex: 1;
	padding: 24px 30px;
	min-width: 0;
}

.tcg-dashboard-content h2 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 22px;
}

/* Alerts
   ========================================================================== */

.tcg-alert {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-size: 14px;
}

.tcg-alert-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.tcg-alert-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Stat boxes
   ========================================================================== */

/* Stat description text
   ========================================================================== */

.tcg-stat-desc {
	font-size: 16px;
	line-height: 1.5;
	color: #666;
}

/* Stat boxes
   ========================================================================== */

.tcg-dashboard-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.tcg-stat-box {
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.tcg-stat-value {
	font-size: 24px;
	font-weight: 700;
	color: #1a1a1a;
	margin-bottom: 4px;
}

.tcg-stat-label {
	font-size: 13px;
	color: #666;
}

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

.tcg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.tcg-table thead th {
	background: #f5f5f5;
	padding: 10px 12px;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid #e0e0e0;
	white-space: nowrap;
	font-size: 13px;
}

.tcg-table tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.tcg-table tbody tr:hover {
	background: #fafafa;
}

/* Status badges
   ========================================================================== */

.tcg-badge-publish,
.tcg-badge-completed,
.tcg-badge-paid {
	background: #d4edda;
	color: #155724;
}

.tcg-badge-draft,
.tcg-badge-on-hold {
	background: #fff3cd;
	color: #856404;
}

.tcg-badge-pending,
.tcg-badge-processing {
	background: #cce5ff;
	color: #004085;
}

/* Buttons
   ========================================================================== */

.tcg-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	text-align: center;
	border: none;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
	line-height: 1.4;
}

.tcg-btn-primary {
	background: #222;
	color: #fff;
}

.tcg-btn-primary:hover {
	background: #444;
	color: #fff;
}

.tcg-btn-secondary {
	background: #e9ecef;
	color: #333;
}

.tcg-btn-secondary:hover {
	background: #ddd;
	color: #222;
}

.tcg-btn-danger {
	background: #dc3545;
	color: #fff;
}

.tcg-btn-danger:hover {
	background: #c82333;
	color: #fff;
}

/* Form controls
   ========================================================================== */

.tcg-product-form {
	max-width: 100%;
}

/* Password toggle */
.tcg-password-wrap {
	position: relative;
}

.tcg-password-wrap .tcg-form-control {
	padding-right: 42px;
}

.tcg-password-toggle {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #888;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
}

.tcg-password-toggle:hover {
	color: #333;
}

.tcg-form-group {
	margin-bottom: 16px;
}

.tcg-form-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.tcg-form-label .required {
	color: #dc3545;
}

.tcg-form-control {
	display: block;
	width: 100%;
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.tcg-form-control:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.tcg-form-help {
	margin-top: 4px;
	font-size: 12px;
	color: #888;
}

.tcg-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 24px;
}

/* Pagination
   ========================================================================== */

.tcg-pagination {
	margin-top: 20px;
	text-align: center;
}

.tcg-pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	margin: 0 2px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 13px;
}

.tcg-pagination .page-numbers.current {
	background: #222;
	color: #fff;
	border-color: #222;
}

.tcg-pagination .page-numbers:hover:not(.current) {
	background: #f5f5f5;
}

/* Order details
   ========================================================================== */

.tcg-order-address {
	background: #f8f9fa;
	padding: 16px;
	border-radius: 6px;
	border: 1px solid #e9ecef;
}

/* Store page
   ========================================================================== */

.tcg-store-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 20px;
}

.tcg-store-header {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid #eee;
}

.tcg-store-logo {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
}

.tcg-store-name {
	margin: 0 0 4px;
	font-size: 28px;
}

.tcg-store-desc {
	margin: 0 0 4px;
	color: #666;
}

.tcg-store-meta {
	margin: 0;
	font-size: 14px;
	color: #999;
}

.tcg-store-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.tcg-store-product-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s;
}

.tcg-store-product-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tcg-store-product-img img {
	width: 100%;
	aspect-ratio: 5 / 7;
	object-fit: cover;
	display: block;
}

.tcg-store-product-info {
	padding: 12px;
}

.tcg-store-product-title {
	margin: 0 0 4px;
	font-size: 14px;
}

.tcg-store-product-title a {
	color: #1a1a1a;
	text-decoration: none;
}

.tcg-store-product-title a:hover {
	text-decoration: underline;
}

.tcg-store-product-price {
	font-weight: 700;
	font-size: 16px;
	color: #1a1a1a;
	margin-bottom: 4px;
}

.tcg-store-product-stock {
	font-size: 12px;
	color: #388e3c;
}

.tcg-store-empty {
	text-align: center;
	color: #666;
	padding: 40px 0;
}

/* Auth (login + register)
   ========================================================================== */

.tcg-auth-wrap {
	width: 100%;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	box-sizing: border-box;
}

.tcg-auth-tabs {
	display: flex;
	border-bottom: 2px solid #e0e0e0;
}

.tcg-auth-tab {
	flex: 1;
	text-align: center;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #666;
	text-decoration: none;
	background: #f8f9fa;
	transition: color 0.15s, background 0.15s;
}

.tcg-auth-tab:hover {
	color: #333;
	background: #eee;
}

.tcg-auth-tab.active {
	color: #1a1a1a;
	background: #fff;
	border-bottom: 2px solid #222;
	margin-bottom: -2px;
}

.tcg-auth-panel {
	padding: 24px 30px 30px;
}

.tcg-registration-form {
	max-width: 440px;
	margin: 40px auto;
	padding: 30px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
}

.tcg-registration-form h2 {
	text-align: center;
	margin-top: 0;
}

/* Product thumbnail
   ========================================================================== */

.tcg-product-thumb {
	width: 40px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
}

/* Small buttons
   ========================================================================== */

.tcg-btn-sm {
	font-size: 13px;
	padding: 4px 10px;
}

.tcg-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

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

@media (max-width: 768px) {
	.tcg-dashboard-wrap {
		flex-direction: column;
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.tcg-dashboard-sidebar {
		width: 100%;
	}

	.tcg-sidebar-header {
		padding: 12px 16px;
	}

	.tcg-nav-menu {
		display: flex;
		overflow-x: auto;
		padding: 0;
		gap: 0;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.tcg-nav-menu::-webkit-scrollbar {
		display: none;
	}

	.tcg-nav-link {
		padding: 10px 14px;
		white-space: nowrap;
		font-size: 13px;
	}

	.tcg-nav-icon {
		display: none;
	}

	.tcg-nav-divider {
		border-top: none;
		margin-top: 0;
		padding-top: 0;
		border-left: 1px solid rgba(255, 255, 255, 0.1);
	}

	.tcg-nav-logout {
		border-top: none;
		margin-top: 0;
		padding-top: 0;
		border-left: 1px solid rgba(255, 255, 255, 0.1);
	}

	.tcg-dashboard-content {
		padding: 16px;
	}

	.tcg-dashboard-content h2 {
		font-size: 18px;
	}

	.tcg-dashboard-stats {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.tcg-stat-value {
		font-size: 20px;
	}

	.tcg-stat-label {
		font-size: 12px;
	}

	/* Products table → stacked cards */
	.tcg-table-products thead {
		display: none;
	}

	.tcg-table-products tbody tr {
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 4px 12px;
		padding: 12px;
		border: 1px solid #e9ecef;
		border-radius: 8px;
		margin-bottom: 10px;
		background: #fff;
	}

	.tcg-table-products tbody tr:hover {
		background: #fff;
	}

	.tcg-table-products tbody td {
		border: none;
		padding: 2px 0;
		font-size: 14px;
	}

	.tcg-table-products tbody td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #666;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
	}

	/* Image cell: spans left column across rows */
	.tcg-table-products tbody td:first-child {
		grid-row: 1 / span 3;
		display: flex;
		align-items: center;
	}

	.tcg-table-products tbody td:first-child::before {
		display: none;
	}

	.tcg-table-products .tcg-product-thumb {
		width: 50px;
		height: 70px;
	}

	/* Other cells stack in right column */
	.tcg-table-products tbody td:not(:first-child) {
		display: flex;
		align-items: center;
		gap: 8px;
	}

	/* Actions: full width at bottom */
	.tcg-table-products tbody td:last-child {
		grid-column: 1 / -1;
		padding-top: 8px;
		margin-top: 4px;
		border-top: 1px solid #f0f0f0;
	}

	.tcg-table-products tbody td:last-child::before {
		display: none;
	}

	.tcg-actions {
		width: 100%;
	}

	.tcg-actions .tcg-btn {
		flex: 1;
		text-align: center;
	}

	/* Orders & earnings tables → stacked cards */
	.tcg-table-orders thead,
	.tcg-table-earnings thead {
		display: none;
	}

	.tcg-table-orders tbody tr,
	.tcg-table-earnings tbody tr {
		display: block;
		padding: 12px;
		border: 1px solid #e9ecef;
		border-radius: 8px;
		margin-bottom: 10px;
		background: #fff;
	}

	.tcg-table-orders tbody tr:hover,
	.tcg-table-earnings tbody tr:hover {
		background: #fff;
	}

	.tcg-table-orders tbody td,
	.tcg-table-earnings tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		border: none;
		padding: 4px 0;
		font-size: 14px;
	}

	.tcg-table-orders tbody td::before,
	.tcg-table-earnings tbody td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #666;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		margin-right: 12px;
	}

	.tcg-table-orders tbody td:last-child,
	.tcg-table-earnings tbody td:last-child {
		padding-top: 8px;
		margin-top: 4px;
		border-top: 1px solid #f0f0f0;
	}

	/* Generic tables without stacked class: horizontal scroll */
	.tcg-table-responsive {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Filters row */
	.tcg-filters {
		display: flex;
		gap: 8px;
		flex-wrap: wrap;
	}

	.tcg-store-products {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.tcg-store-header {
		flex-direction: column;
		text-align: center;
	}

	.tcg-store-name {
		font-size: 22px;
	}

	.tcg-shipping-fields {
		flex-direction: column;
	}

	.tcg-form-actions {
		flex-direction: column;
	}

	.tcg-form-actions .tcg-btn {
		text-align: center;
	}

	.tcg-pagination .page-numbers {
		padding: 8px 12px;
	}
}

@media (max-width: 480px) {
	.tcg-dashboard-content {
		padding: 12px;
	}

	.tcg-dashboard-stats {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.tcg-stat-box {
		padding: 12px 8px;
	}

	.tcg-stat-value {
		font-size: 18px;
	}

	.tcg-store-products {
		grid-template-columns: 1fr;
		gap: 8px;
	}
}

/* Product search dropdown
   ========================================================================== */

.tcg-product-search {
	position: relative;
}

.tcg-product-search .tcg-live-search-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 99999;
	max-height: 400px;
	overflow-y: auto;
}

.tcg-product-search .tcg-live-search-item a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: #1a1a1a;
	transition: background-color 0.15s;
}

.tcg-product-search .tcg-live-search-item a:hover,
.tcg-product-search .tcg-live-search-active a {
	background-color: #f5f5f5;
}

.tcg-product-search .tcg-live-search-thumb {
	width: 40px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.tcg-product-search .tcg-live-search-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tcg-product-search .tcg-live-search-title {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tcg-product-search .tcg-live-search-title mark {
	background-color: #fff3cd;
	color: inherit;
	padding: 0;
	border-radius: 2px;
}

.tcg-product-search .tcg-live-search-meta {
	font-size: 12px;
	color: #888;
}

.tcg-product-search .tcg-live-search-empty {
	padding: 16px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* Bulk add by set
   ========================================================================== */

.tcg-bulk-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.tcg-bulk-card {
	display: flex;
	flex-direction: column;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
	background: #fff;
	position: relative;
}

.tcg-bulk-card:hover {
	border-color: #999;
}

.tcg-bulk-card:has(.tcg-bulk-checkbox:checked) {
	border-color: #222;
	box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.2);
}

.tcg-bulk-card--exists {
	opacity: 0.5;
	cursor: default;
}

.tcg-bulk-card--exists:hover {
	border-color: #e0e0e0;
}

.tcg-bulk-checkbox {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.tcg-bulk-card-img {
	aspect-ratio: 5 / 7;
	background: #f5f5f5;
	overflow: hidden;
}

.tcg-bulk-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tcg-bulk-card-info {
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tcg-bulk-card-title {
	font-size: 12px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tcg-bulk-card-code {
	font-size: 11px;
	color: #888;
}

.tcg-bulk-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-top: 1px solid #e0e0e0;
	margin-top: 8px;
	position: sticky;
	bottom: 0;
	background: #fff;
}

.tcg-bulk-select-all {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	cursor: pointer;
	font-weight: 500;
}

#tcg-bulk-count {
	font-size: 13px;
	color: #666;
	flex: 1;
}

@media (max-width: 480px) {
	.tcg-bulk-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.tcg-bulk-actions {
		flex-wrap: wrap;
		gap: 10px;
	}
}

/* Shipping fields
   ========================================================================== */

.tcg-shipping-zone {
	margin-bottom: 16px;
}

.tcg-shipping-fields {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-top: 6px;
}

.tcg-shipping-field {
	display: flex;
	align-items: center;
	gap: 6px;
}

.tcg-shipping-field input[type="number"] {
	width: 80px;
}

.tcg-shipping-prefix {
	font-weight: 600;
	color: #555;
}

.tcg-shipping-days span {
	color: #666;
	font-size: 14px;
}

/* Payment fields
   ========================================================================== */

.tcg-payment-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}

.tcg-payment-bank {
	margin-bottom: 16px;
}

.tcg-payment-bank-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 6px;
}

@media (max-width: 600px) {
	.tcg-payment-grid,
	.tcg-payment-bank-fields {
		grid-template-columns: 1fr;
	}
}

/* Onboarding
   ========================================================================== */

.tcg-onboarding-wrap {
	border: none;
}

.tcg-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin-bottom: 32px;
}

.tcg-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 80px;
}

.tcg-step-number {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	background: #e0e0e0;
	color: #999;
	transition: all 0.2s;
}

.tcg-step.active .tcg-step-number {
	background: #222;
	color: #fff;
}

.tcg-step.completed .tcg-step-number {
	background: #4caf50;
	color: #fff;
}

.tcg-step-label {
	font-size: 12px;
	color: #999;
	text-align: center;
}

.tcg-step.active .tcg-step-label {
	color: #222;
	font-weight: 600;
}

.tcg-step.completed .tcg-step-label {
	color: #4caf50;
}

.tcg-step-line {
	flex: 1;
	height: 2px;
	background: #e0e0e0;
	margin: 0 8px;
	margin-bottom: 22px;
}

.tcg-step-line.completed {
	background: #4caf50;
}

@media (max-width: 480px) {
	.tcg-step-label {
		font-size: 10px;
	}

	.tcg-step {
		min-width: 60px;
	}
}
