/**
 * Grafline – My Account / Dashboard Styles
 * B2B and B2C dashboard widgets, tier badges, portal layout.
 */

/* ============================================
   DASHBOARD WIDGET (shared)
   ============================================ */

.grafline-dashboard {
	background: var(--grafline-bg);
	border: 1px solid var(--grafline-border);
	border-radius: var(--radius-xl);
	padding: var(--spacing-lg);
	margin-bottom: var(--spacing-lg);
}

.grafline-dashboard__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--spacing-md);
}

.grafline-dashboard__header h3 {
	margin: 0;
	font-size: var(--font-size-xl);
}

.grafline-dashboard__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--spacing-md);
	margin-bottom: var(--spacing-lg);
}

.grafline-dashboard__card {
	background: var(--grafline-bg-light);
	border-radius: var(--radius-md);
	padding: var(--spacing-md);
	text-align: center;
}

.grafline-dashboard__label {
	display: block;
	font-size: var(--font-size-sm);
	color: var(--grafline-text-light);
	margin-bottom: var(--spacing-xs);
}

.grafline-dashboard__card strong {
	font-size: var(--font-size-lg);
	color: var(--grafline-text);
}

.grafline-dashboard__actions {
	display: flex;
	gap: var(--spacing-sm);
	flex-wrap: wrap;
}

.grafline-dashboard__next-tier {
	font-size: var(--font-size-sm);
	color: var(--grafline-text-light);
	margin-bottom: var(--spacing-md);
}

/* ============================================
   BADGES
   ============================================ */

.grafline-badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	font-size: var(--font-size-sm);
	font-weight: 600;
	border-radius: 100px;
	white-space: nowrap;
}

.grafline-badge--success {
	background: #d1fae5;
	color: #065f46;
}

.grafline-badge--warning {
	background: #fef3c7;
	color: #92400e;
}

.grafline-badge--tier {
	background: var(--grafline-primary);
	color: #fff;
}

/* ============================================
   B2B PORTAL
   ============================================ */

.grafline-b2b-portal {
	max-width: 800px;
}

.grafline-b2b-portal .b2b-info {
	background: var(--grafline-bg-light);
	border-radius: var(--radius-lg);
	padding: var(--spacing-lg);
	margin-bottom: var(--spacing-lg);
}

.grafline-b2b-portal .b2b-actions {
	display: flex;
	gap: var(--spacing-sm);
	margin-bottom: var(--spacing-xl);
}

/* ============================================
   B2B REGISTRATION FORM
   ============================================ */

.grafline-b2b-registration {
	max-width: 600px;
	margin: 0 auto;
}

.grafline-b2b-registration h2 {
	margin-bottom: var(--spacing-sm);
}

.grafline-b2b-registration h3 {
	margin-top: var(--spacing-lg);
	margin-bottom: var(--spacing-sm);
	padding-bottom: var(--spacing-xs);
	border-bottom: 1px solid var(--grafline-border);
}

/* ============================================
   TABLES (orders, quotes)
   ============================================ */

.b2b-order-history table,
.b2b-quote-history table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: var(--spacing-lg);
}

.b2b-order-history th,
.b2b-quote-history th {
	text-align: left;
	padding: 0.75rem;
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--grafline-text-light);
	border-bottom: 2px solid var(--grafline-border);
}

.b2b-order-history td,
.b2b-quote-history td {
	padding: 0.75rem;
	border-bottom: 1px solid var(--grafline-border);
	font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
	.grafline-dashboard__grid {
		grid-template-columns: 1fr;
	}

	.grafline-dashboard__actions {
		flex-direction: column;
	}

	.grafline-dashboard__actions .btn {
		width: 100%;
		text-align: center;
	}
}

/* ============================================
   ACCOUNT / DASHBOARD - RESPONSIVE
   ============================================ */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
	.grafline-dashboard__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Mobile: < 768px */
@media (max-width: 768px) {
	.grafline-dashboard {
		padding: var(--spacing-md);
		margin-bottom: var(--spacing-md);
	}

	.grafline-dashboard__header {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--spacing-xs);
		margin-bottom: var(--spacing-sm);
	}

	.grafline-dashboard__header h3 {
		font-size: var(--font-size-lg);
	}

	.grafline-dashboard__grid {
		grid-template-columns: 1fr;
		gap: var(--spacing-sm);
		margin-bottom: var(--spacing-md);
	}

	.grafline-dashboard__card {
		padding: var(--spacing-sm);
	}

	.grafline-dashboard__label {
		font-size: 0.75rem;
	}

	.grafline-dashboard__card strong {
		font-size: var(--font-size-base);
	}

	.grafline-dashboard__actions {
		flex-direction: column;
		gap: var(--spacing-xs);
	}

	.grafline-dashboard__actions .btn {
		width: 100%;
		text-align: center;
		min-height: 44px;
	}

	.grafline-dashboard__next-tier {
		font-size: 0.75rem;
		margin-bottom: var(--spacing-sm);
	}
	
	/* BADGES */
	.grafline-badge {
		padding: 0.25rem 0.625rem;
		font-size: 0.75rem;
	}
	
	/* B2B PORTAL */
	.grafline-b2b-portal {
		max-width: 100%;
	}

	.grafline-b2b-portal .b2b-info {
		padding: var(--spacing-md);
		margin-bottom: var(--spacing-md);
	}

	.grafline-b2b-portal .b2b-actions {
		flex-direction: column;
		gap: var(--spacing-xs);
		margin-bottom: var(--spacing-lg);
	}
	
	.grafline-b2b-portal .b2b-actions .btn {
		width: 100%;
	}
	
	/* B2B REGISTRATION */
	.grafline-b2b-registration {
		max-width: 100%;
		padding: 0 1rem;
	}

	.grafline-b2b-registration h2 {
		font-size: var(--font-size-xl);
		margin-bottom: var(--spacing-xs);
	}

	.grafline-b2b-registration h3 {
		font-size: var(--font-size-base);
		margin-top: var(--spacing-md);
		margin-bottom: var(--spacing-xs);
	}
	
	/* TABLES */
	.b2b-order-history table,
	.b2b-quote-history table {
		font-size: var(--font-size-sm);
		margin-bottom: var(--spacing-md);
	}

	.b2b-order-history th,
	.b2b-quote-history th {
		padding: 0.5rem;
		font-size: 0.75rem;
	}

	.b2b-order-history td,
	.b2b-quote-history td {
		padding: 0.5rem;
		font-size: 0.75rem;
	}
	
	/* Make tables scrollable on small screens */
	.b2b-order-history,
	.b2b-quote-history {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	
	.b2b-order-history table,
	.b2b-quote-history table {
		min-width: 500px;
	}
}

/* Small mobile: < 480px */
@media (max-width: 480px) {
	.grafline-dashboard {
		padding: var(--spacing-sm);
	}
	
	.grafline-dashboard__header h3 {
		font-size: var(--font-size-base);
	}
	
	.grafline-dashboard__card {
		padding: 0.75rem;
	}
	
	.grafline-b2b-registration h2 {
		font-size: var(--font-size-lg);
	}
	
	.b2b-order-history th,
	.b2b-quote-history th,
	.b2b-order-history td,
	.b2b-quote-history td {
		padding: 0.375rem;
		font-size: 0.7rem;
	}
}
