/**
 * studio66 Customer Portal — Frontend Styles
 *
 * Design principles: minimal, premium, clean, fast.
 * Studio66 red: #EC0000
 * Typography: system font stack (no external fonts).
 * No framework dependencies — vanilla CSS only.
 *
 * @package Studio66\Portal
 * @since   1.0.0
 */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
	--s66p-red:         #EC0000;
	--s66p-red-hover:   #c00000;
	--s66p-text:        #1a1a2e;
	--s66p-text-muted:  #6b7280;
	--s66p-border:      #e5e7eb;
	--s66p-bg:          #f9fafb;
	--s66p-white:       #ffffff;
	--s66p-nav-width:   220px;
	--s66p-radius:      6px;
	--s66p-shadow-sm:   0 1px 3px rgba(0,0,0,.06);
	--s66p-shadow:      0 4px 12px rgba(0,0,0,.08);
	--s66p-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	--s66p-transition:  0.15s ease;
}

/* ── Portal wrapper ────────────────────────────────────────────────────────── */
.s66portal {
	display: flex;
	gap: 0;
	min-height: 600px;
	font-family: var(--s66p-font);
	font-size: 15px;
	color: var(--s66p-text);
	background: var(--s66p-bg);
	border-radius: var(--s66p-radius);
	overflow: hidden;
	box-shadow: var(--s66p-shadow);
}

/* ── Navigation sidebar ────────────────────────────────────────────────────── */
.s66portal-nav {
	width: var(--s66p-nav-width);
	flex-shrink: 0;
	background: var(--s66p-white);
	border-right: 1px solid var(--s66p-border);
	padding: 20px 0;
}

.s66portal-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.s66portal-nav__item {
	margin: 0;
}

.s66portal-nav__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	color: var(--s66p-text-muted);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color var(--s66p-transition), background var(--s66p-transition);
	border-left: 3px solid transparent;
}

.s66portal-nav__link:hover {
	color: var(--s66p-red);
	background: rgba(236, 0, 0, .04);
	border-left-color: rgba(236, 0, 0, .3);
}

.s66portal-nav__item--active .s66portal-nav__link {
	color: var(--s66p-red);
	background: rgba(236, 0, 0, .06);
	border-left-color: var(--s66p-red);
	font-weight: 600;
}

.s66portal-nav__icon {
	font-size: 16px !important;
	width: 16px !important;
	height: 16px !important;
	flex-shrink: 0;
	opacity: 0.8;
}

.s66portal-nav__item--active .s66portal-nav__icon {
	opacity: 1;
}

/* ── Content area ──────────────────────────────────────────────────────────── */
.s66portal > section,
.s66portal-section,
.s66portal-section-placeholder {
	flex: 1;
	padding: 32px 36px;
	min-width: 0; /* prevent flex overflow */
}

/* ── Section header ────────────────────────────────────────────────────────── */
.s66portal-section__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: 28px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--s66p-border);
}

.s66portal-section__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0;
	color: var(--s66p-text);
	line-height: 1.2;
}

.s66portal-section__subtitle {
	font-size: 13px;
	color: var(--s66p-text-muted);
	margin: 4px 0 0;
}

/* ── Card grid ─────────────────────────────────────────────────────────────── */
.s66portal-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.s66portal-card {
	background: var(--s66p-white);
	border: 1px solid var(--s66p-border);
	border-radius: var(--s66p-radius);
	padding: 20px;
	box-shadow: var(--s66p-shadow-sm);
	transition: border-color var(--s66p-transition), box-shadow var(--s66p-transition);
	text-decoration: none;
	color: inherit;
	display: block;
}

.s66portal-card:hover {
	border-color: var(--s66p-red);
	box-shadow: 0 4px 16px rgba(236, 0, 0, .10);
}

.s66portal-card__title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 6px;
	color: var(--s66p-text);
}

.s66portal-card__meta {
	font-size: 12px;
	color: var(--s66p-text-muted);
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.s66portal-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.s66portal-table th {
	text-align: left;
	padding: 10px 14px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--s66p-text-muted);
	border-bottom: 2px solid var(--s66p-border);
	background: transparent;
}

.s66portal-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--s66p-border);
	color: var(--s66p-text);
	vertical-align: middle;
}

.s66portal-table tr:last-child td {
	border-bottom: none;
}

.s66portal-table tr:hover td {
	background: var(--s66p-bg);
}

/* ── Status badges ─────────────────────────────────────────────────────────── */
.s66portal-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.s66portal-badge--active,
.s66portal-badge--open,
.s66portal-badge--paid     { background: #dcfce7; color: #166534; }

.s66portal-badge--pending,
.s66portal-badge--in-progress { background: #fef9c3; color: #854d0e; }

.s66portal-badge--closed,
.s66portal-badge--expired,
.s66portal-badge--cancelled { background: #f4f4f5; color: #71717a; }

.s66portal-badge--draft      { background: #dbeafe; color: #1e40af; }

/* ── Progress bar ──────────────────────────────────────────────────────────── */
.s66portal-progress {
	height: 6px;
	background: var(--s66p-border);
	border-radius: 3px;
	overflow: hidden;
}

.s66portal-progress__fill {
	height: 100%;
	background: var(--s66p-red);
	border-radius: 3px;
	transition: width 0.4s ease;
}

.s66portal-progress__fill--warning {
	background: #f59e0b;
}

.s66portal-progress__fill--low {
	background: var(--s66p-red);
}

/* ── Bundle card ───────────────────────────────────────────────────────────── */
.s66portal-bundle {
	background: var(--s66p-white);
	border: 1px solid var(--s66p-border);
	border-radius: var(--s66p-radius);
	padding: 20px 24px;
	box-shadow: var(--s66p-shadow-sm);
}

.s66portal-bundle__name {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 4px;
}

.s66portal-bundle__hours {
	font-size: 28px;
	font-weight: 700;
	color: var(--s66p-text);
	margin: 12px 0 4px;
}

.s66portal-bundle__hours span {
	font-size: 14px;
	font-weight: 400;
	color: var(--s66p-text-muted);
}

.s66portal-bundle__progress-label {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--s66p-text-muted);
	margin: 8px 0 4px;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.s66portal-empty {
	text-align: center;
	padding: 48px 24px;
}

.s66portal-empty__icon {
	font-size: 40px !important;
	width: 40px !important;
	height: 40px !important;
	color: var(--s66p-border);
	margin-bottom: 12px;
}

.s66portal-empty__title {
	font-size: 16px;
	font-weight: 600;
	color: var(--s66p-text-muted);
	margin: 0 0 6px;
}

.s66portal-empty__text {
	font-size: 13px;
	color: var(--s66p-text-muted);
	max-width: 300px;
	margin: 0 auto;
}

/* ── Login notice ──────────────────────────────────────────────────────────── */
.s66portal--guest {
	justify-content: center;
	align-items: center;
	min-height: 200px;
	background: var(--s66p-white);
}

.s66portal-login-notice {
	font-size: 15px;
	color: var(--s66p-text-muted);
}

.s66portal-login-notice a {
	color: var(--s66p-red);
	font-weight: 600;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.s66portal {
		flex-direction: column;
	}

	.s66portal-nav {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--s66p-border);
		padding: 8px 0;
	}

	.s66portal-nav__list {
		display: flex;
		overflow-x: auto;
		gap: 0;
		padding: 0 8px;
		-webkit-overflow-scrolling: touch;
	}

	.s66portal-nav__link {
		white-space: nowrap;
		padding: 8px 14px;
		border-left: none;
		border-bottom: 3px solid transparent;
	}

	.s66portal-nav__link:hover {
		border-left-color: transparent;
		border-bottom-color: rgba(236, 0, 0, .3);
	}

	.s66portal-nav__item--active .s66portal-nav__link {
		border-left-color: transparent;
		border-bottom-color: var(--s66p-red);
	}

	.s66portal > section,
	.s66portal-section {
		padding: 24px 20px;
	}
}

@media (max-width: 600px) {
	.s66portal-card-grid {
		grid-template-columns: 1fr;
	}

	.s66portal-section__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
}
