/**
 * SleepOps My Dashboard Styles
 */

/* ——— Container ——— */
.smd-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	color: #1a1a1a;
}

/* ——— Header ——— */
.smd-header {
	text-align: center;
	margin-bottom: 2rem;
}
.smd-title {
	font-size: 2.25rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: #1a1a1a;
}
.smd-subtitle {
	font-size: 1.05rem;
	color: #555;
	margin: 0;
}

/* ——— Loading / Error / Empty ——— */
.smd-loading,
.smd-error,
.smd-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #666;
}
.smd-error p {
	color: #b91c1c;
	background: #fee2e2;
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
}
.smd-empty-inner {
	max-width: 480px;
	margin: 0 auto;
}
.smd-empty-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
}
.smd-empty-inner h2 {
	font-size: 1.4rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
}
.smd-empty-inner p {
	color: #555;
	margin: 0 0 1.5rem;
	line-height: 1.6;
}

/* ——— Stats Row ——— */
.smd-stats-row {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.75rem;
	flex-wrap: wrap;
}
.smd-stat-card {
	flex: 1 1 140px;
	background: #f0f7ff;
	border-radius: 8px;
	padding: 1.1rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
}
.smd-stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: #2563eb;
}
.smd-stat-label {
	font-size: 0.82rem;
	color: #555;
	text-align: center;
}

/* ——— Sections ——— */
.smd-section {
	background: #fff;
	border-radius: 10px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.smd-section-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 1.25rem;
	color: #1a1a1a;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid #f0f0f0;
}
.smd-sub-title {
	font-size: 1rem;
	font-weight: 600;
	color: #374151;
	margin: 0 0 0.6rem;
}

/* ——— Latest Assessment ——— */
.smd-latest-date {
	font-size: 0.9rem;
	color: #888;
	margin: 0 0 1rem;
}

/* Layers */
.smd-layers-wrap,
.smd-tags-wrap,
.smd-recs-wrap {
	margin-bottom: 1.25rem;
}
.smd-layers-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.smd-layer-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.65rem 0;
	border-bottom: 1px solid #f0f0f0;
	gap: 0.5rem;
}
.smd-layer-item:last-child {
	border-bottom: none;
}
.smd-layer-name {
	font-weight: 500;
	flex: 1;
}
.smd-layer-badge {
	font-size: 0.8rem;
	padding: 0.25rem 0.65rem;
	border-radius: 20px;
	font-weight: 500;
	white-space: nowrap;
}
.smd-severity-low    { background: #d1fae5; color: #065f46; }
.smd-severity-medium { background: #fef3c7; color: #92400e; }
.smd-severity-high   { background: #fee2e2; color: #991b1b; }

/* Tags */
.smd-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.smd-tag {
	background: #e5e7eb;
	color: #374151;
	font-size: 0.8rem;
	padding: 0.25rem 0.65rem;
	border-radius: 20px;
}

/* Recommendations */
.smd-rec-card {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	background: #f9fafb;
	border-radius: 6px;
	margin-bottom: 0.65rem;
	flex-wrap: wrap;
}
.smd-rec-card:last-child {
	margin-bottom: 0;
}
.smd-rec-type {
	font-size: 0.72rem;
	font-weight: 600;
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
}
.smd-rec-type-setup  { background: #dbeafe; color: #1d4ed8; }
.smd-rec-type-guide  { background: #ede9fe; color: #6d28d9; }
.smd-rec-title {
	flex: 1;
	font-size: 0.95rem;
	color: #1a1a1a;
}

/* ——— Trend Charts ——— */
.smd-trend-layer {
	margin-bottom: 1.75rem;
}
.smd-trend-layer:last-child {
	margin-bottom: 0;
}
.smd-trend-layer-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #374151;
	margin: 0 0 0.75rem;
}
.smd-trend-chart {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 80px;
	padding-bottom: 1.4rem;
	position: relative;
	overflow-x: auto;
	border-bottom: 1px solid #e5e7eb;
}
.smd-trend-bar-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	flex-shrink: 0;
	height: 100%;
	position: relative;
}
.smd-trend-bar {
	width: 100%;
	background: #2563eb;
	border-radius: 3px 3px 0 0;
	min-height: 2px;
	transition: height 0.3s;
	cursor: help;
}
.smd-trend-bar:hover {
	background: #1d4ed8;
}
.smd-trend-date {
	position: absolute;
	bottom: -1.3rem;
	font-size: 0.65rem;
	color: #888;
	white-space: nowrap;
	transform: rotate(-40deg);
	transform-origin: top left;
}

/* ——— Actions ——— */
.smd-actions-section {
	text-align: center;
}

/* ——— Buttons ——— */
.smd-btn {
	display: inline-block;
	padding: 0.65rem 1.5rem;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
}
.smd-btn-primary {
	background: #2563eb;
	color: #fff;
}
.smd-btn-primary:hover {
	background: #1d4ed8;
	color: #fff;
}
.smd-btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
}
.smd-btn-secondary:hover {
	background: #e5e7eb;
	color: #1a1a1a;
}
.smd-btn-sm {
	padding: 0.35rem 0.85rem;
	font-size: 0.82rem;
}

/* ——— Privacy note ——— */
.smd-privacy-note {
	text-align: center;
	font-size: 0.78rem;
	color: #aaa;
	margin-top: 2rem;
}

/* ——— Responsive ——— */
@media (max-width: 640px) {
	.smd-title {
		font-size: 1.75rem;
	}
	.smd-stats-row {
		flex-direction: column;
	}
	.smd-stat-card {
		flex-direction: row;
		justify-content: space-between;
		padding: 0.9rem 1rem;
	}
	.smd-stat-value {
		font-size: 1.2rem;
	}
	.smd-rec-card {
		flex-direction: column;
		align-items: flex-start;
	}

	.smd-adherence-stats {
		flex-direction: column;
	}

	.smd-adherence-stat-card {
		flex-direction: row;
		justify-content: space-between;
		padding: 0.9rem 1rem;
	}
}

/* =========================================================
   Setup Adherence Section
   ========================================================= */

.smd-adherence-empty {
	color: #888;
	font-size: 0.95rem;
}

/* Stats row */
.smd-adherence-stats {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.smd-adherence-stat-card {
	flex: 1 1 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1rem;
	background: #f0f7ff;
	border: 1px solid #cce0ff;
	border-radius: 10px;
	text-align: center;
}

.smd-adherence-stat-value {
	font-size: 1.8rem;
	font-weight: 700;
	color: #1a4d8f;
	line-height: 1;
	margin-bottom: 0.35rem;
}

.smd-adherence-stat-label {
	font-size: 0.8rem;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Progress bar */
.smd-adherence-score-wrap,
.smd-adherence-outcome-wrap {
	margin-bottom: 1.25rem;
}

.smd-adherence-score-label {
	font-size: 0.95rem;
	color: #333;
	margin-bottom: 0.5rem;
}

.smd-adherence-score-label strong {
	color: #1a4d8f;
}

.smd-adherence-bar-track {
	height: 10px;
	background: #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
}

.smd-adherence-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #1a73e8, #28a745);
	border-radius: 6px;
	transition: width 0.5s ease;
}

.smd-adherence-bar-track--outcome .smd-adherence-bar-fill--outcome {
	background: linear-gradient(90deg, #f5a623, #e67e22);
}

.smd-adherence-outcome-note {
	font-size: 0.8rem;
	color: #888;
	margin-top: 0.4rem;
}

/* Most active setup */
.smd-adherence-top-setup {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
	flex-wrap: wrap;
}

.smd-adherence-top-setup-label {
	font-size: 0.9rem;
	color: #555;
}
