/* Smart Task & Productivity Manager — Frontend Dashboard Styles */

.stpm-app {
	/* Palette: deep teal as the single brand accent, on a neutral warm-grey
	   ground. Green / amber / rust are reserved strictly for task state
	   (done / waiting / late) so colour always means the same thing. */
	--stpm-primary: #0f5d63;
	--stpm-primary-dark: #0b474c;
	--stpm-primary-soft: #e3eeee;
	--stpm-green: #2f7d4f;
	--stpm-green-soft: #e4efe7;
	--stpm-orange: #a96a12;
	--stpm-orange-soft: #f6eddb;
	--stpm-red: #a8443a;
	--stpm-red-soft: #f6e6e3;
	--stpm-bg: #f2f3f1;
	--stpm-card: #ffffff;
	--stpm-text: #1a201f;
	--stpm-text-soft: #4c5553;
	--stpm-text-muted: #7b8482;
	--stpm-border: #e2e5e1;
	--stpm-radius: 14px;
	--stpm-radius-sm: 10px;
	--stpm-shadow: 0 1px 2px rgba(22, 25, 43, 0.04), 0 4px 14px rgba(22, 25, 43, 0.05);
	--stpm-shadow-lift: 0 2px 4px rgba(22, 25, 43, 0.05), 0 10px 28px rgba(22, 25, 43, 0.09);

	max-width: 480px;
	margin: 0 auto;
	background: var(--stpm-bg);
	color: var(--stpm-text);
	--stpm-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--stpm-display: "Bricolage Grotesque", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-family: var(--stpm-sans);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	letter-spacing: -0.006em;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--stpm-shadow-lift);
	position: relative;
	min-height: 640px;
	box-sizing: border-box;
}
.stpm-app :focus-visible {
	outline: 2px solid var(--stpm-primary);
	outline-offset: 2px;
	border-radius: 6px;
}
.stpm-ico { flex-shrink: 0; vertical-align: -0.18em; }
.stpm-app *,
.stpm-app *::before,
.stpm-app *::after {
	box-sizing: border-box;
}

/* ---------- Top bar ---------- */
.stpm-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 10px;
	background: var(--stpm-bg);
}
.stpm-topbar-title {
	font-family: var(--stpm-display);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.026em;
}
.stpm-topbar-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--stpm-card);
	box-shadow: 0 0 0 1px var(--stpm-border);
}
.stpm-icon-btn {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 17px;
	font-family: inherit;
	color: var(--stpm-text-soft);
	padding: 0;
}
.stpm-icon-btn:hover { background: var(--stpm-bg); }

/* ---------- Views ---------- */
.stpm-views {
	padding: 4px 20px 90px;
	min-height: 500px;
}
.stpm-view {
	display: none;
	animation: stpm-fade-in 0.18s ease;
}
.stpm-view.is-active {
	display: block;
}
@keyframes stpm-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero ----------
   The home hero answers "what should I do now", not "how am I doing".
   The figure is secondary; the next task is the thing you can act on. */
.stpm-hero {
	background: var(--stpm-primary);
	color: #fff;
	border-radius: var(--stpm-radius);
	padding: 20px 20px 16px;
	margin-bottom: 14px;
}
.stpm-hero-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}
.stpm-hero-head h2 {
	font-family: var(--stpm-display);
	margin: 0 0 2px;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.024em;
	line-height: 1.15;
}
.stpm-hero-head p {
	margin: 0;
	font-size: 13px;
	color: rgba(255,255,255,0.7);
}
.stpm-hero-figure {
	text-align: right;
	line-height: 1;
	flex-shrink: 0;
}
.stpm-hero-num {
	font-family: var(--stpm-display);
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}
.stpm-hero-pct { font-size: 15px; font-weight: 500; opacity: 0.65; margin-left: 1px; }
.stpm-hero-figure-label {
	display: block;
	font-size: 11px;
	color: rgba(255,255,255,0.6);
	margin-top: 5px;
}

/* One tick per task due today; filled ticks are done. */
.stpm-hero-track {
	display: flex;
	gap: 3px;
	min-height: 5px;
	margin-bottom: 14px;
}
.stpm-hero-track:empty { display: none; }
.stpm-seg {
	flex: 1;
	height: 5px;
	border-radius: 3px;
	background: rgba(255,255,255,0.22);
}
.stpm-seg.is-done { background: rgba(255,255,255,0.92); }
.stpm-hero-bar {
	flex: 1;
	height: 5px;
	border-radius: 3px;
	background: rgba(255,255,255,0.22);
	overflow: hidden;
}
.stpm-hero-bar-fill { height: 100%; background: rgba(255,255,255,0.92); border-radius: 3px; }

.stpm-hero-next {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	border-top: 1px solid rgba(255,255,255,0.16);
	padding-top: 14px;
}
.stpm-hero-next-btn {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 1.8px solid rgba(255,255,255,0.5);
	background: transparent;
	cursor: pointer;
	flex-shrink: 0;
	margin-top: 2px;
	padding: 0;
}
.stpm-hero-next-btn:hover { border-color: #fff; background: rgba(255,255,255,0.14); }
.stpm-hero-next-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stpm-hero-next-label {
	font-size: 11px;
	color: rgba(255,255,255,0.6);
}
.stpm-hero-next-title {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	word-break: break-word;
}
.stpm-hero-next-meta { font-size: 12px; color: rgba(255,255,255,0.68); }
.stpm-hero-next-empty { font-size: 13px; color: rgba(255,255,255,0.72); }

/* ---------- Stat strip ----------
   One surface split by hairlines rather than four floating cards: these
   four numbers are one reading, not four separate objects. */
.stpm-stat-strip {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	margin-bottom: 14px;
	overflow: hidden;
}
.stpm-stat {
	padding: 13px 10px 12px;
	text-align: center;
	border-right: 1px solid var(--stpm-border);
}
.stpm-stat:last-child { border-right: none; }
.stpm-stat-value {
	display: block;
	font-family: var(--stpm-display);
	font-size: 21px;
	font-weight: 600;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}
.stpm-stat-label {
	display: block;
	font-size: 11px;
	color: var(--stpm-text-muted);
	margin-top: 3px;
}
.stpm-accent-green .stpm-stat-value { color: var(--stpm-green); }
.stpm-accent-orange .stpm-stat-value { color: var(--stpm-orange); }

/* ---------- Buttons ---------- */
.stpm-btn {
	border: none;
	border-radius: var(--stpm-radius-sm);
	padding: 11px 18px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	transition: background-color 0.15s ease;
}
.stpm-btn:active { transform: scale(0.98); }
.stpm-btn-primary {
	background: var(--stpm-primary);
	color: #fff;
}
.stpm-btn-primary:hover { background: var(--stpm-primary-dark); }
.stpm-btn-block { width: 100%; margin-bottom: 20px; }
.stpm-btn-small { padding: 8px 14px; font-size: 13px; }
.stpm-link-btn {
	background: none;
	border: none;
	color: var(--stpm-primary);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.stpm-back-btn {
	background: none;
	border: none;
	color: var(--stpm-primary);
	font-weight: 600;
	font-size: 14px;
	padding: 12px 0;
	cursor: pointer;
}

/* ---------- Section header ---------- */
.stpm-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 6px 0 12px;
}
.stpm-section-header h3 {
	font-family: var(--stpm-display);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.018em;
	margin: 0;
}

/* ---------- Mini project bars ---------- */
.stpm-mini-projects {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	overflow: hidden;
	margin-bottom: 10px;
}
.stpm-mini-project {
	padding: 12px 14px;
	cursor: pointer;
	border-bottom: 1px solid var(--stpm-border);
	transition: background-color 0.13s ease;
}
.stpm-mini-project:last-child { border-bottom: none; }
.stpm-mini-project:hover { background: #fafbf9; }
.stpm-mini-project-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.stpm-mini-project-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
}
.stpm-mini-project-count { color: var(--stpm-text-muted); font-weight: 500; }
.stpm-progress-bar {
	height: 6px;
	border-radius: 6px;
	background: #e6e9e5;
	overflow: hidden;
}
.stpm-progress-bar-fill {
	height: 100%;
	border-radius: 6px;
	background: var(--stpm-primary);
	transition: width 0.3s ease;
}
.stpm-empty-state {
	text-align: center;
	color: var(--stpm-text-muted);
	font-size: 13px;
	line-height: 1.6;
	padding: 34px 20px;
}
/* When a list panel holds only the empty message, the panel border would
   read as a container around nothing — drop it and keep the message. */
.stpm-task-list:has(> .stpm-empty-state),
.stpm-routine-list:has(> .stpm-empty-state),
.stpm-mini-projects:has(> .stpm-empty-state),
.stpm-projects-list:has(> .stpm-empty-state) {
	background: transparent;
	border: 1px dashed var(--stpm-border);
}

/* ---------- Projects list ---------- */
.stpm-projects-list { display: flex; flex-direction: column; gap: 12px; }
.stpm-project-card {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	padding: 15px;
	position: relative;
	cursor: pointer;
	transition: border-color 0.15s ease;
}
.stpm-project-card:hover { border-color: #ccd2cd; }
.stpm-project-card-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.stpm-project-icon {
	width: 36px;
	height: 36px;
	border-radius: var(--stpm-radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.stpm-project-name { font-family: var(--stpm-display); font-weight: 600; font-size: 15px; letter-spacing: -0.018em; flex: 1; min-width: 0; }
.stpm-project-desc { font-size: 12px; color: var(--stpm-text-muted); margin: 0 0 10px; }
.stpm-project-stats {
	display: flex;
	gap: 14px;
	font-size: 12px;
	color: var(--stpm-text-muted);
	margin-bottom: 8px;
}
.stpm-project-menu-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: var(--stpm-text-muted);
	padding: 4px 8px;
}

/* ---------- Filter tabs ---------- */
.stpm-filter-tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 4px;
	margin-bottom: 14px;
}
.stpm-filter-tab {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: 20px;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--stpm-text-muted);
	cursor: pointer;
	white-space: nowrap;
}
.stpm-filter-tab.is-active {
	background: var(--stpm-primary);
	border-color: var(--stpm-primary);
	color: #fff;
}

/* ---------- Quick add ---------- */
.stpm-quick-add {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}
.stpm-quick-add input {
	flex: 1;
	border: 1px solid var(--stpm-border);
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 14px;
	background: var(--stpm-card);
}

/* ---------- Task list ----------
   A run of tasks is one list, so it gets one surface with hairline
   dividers rather than a stack of identical floating cards. */
.stpm-task-list {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	overflow: hidden;
	margin-bottom: 14px;
}
.stpm-task-list:empty { display: none; }
.stpm-task-card {
	padding: 12px 14px;
	display: flex;
	align-items: flex-start;
	gap: 11px;
	border-bottom: 1px solid var(--stpm-border);
	transition: background-color 0.13s ease;
}
.stpm-task-card:last-child { border-bottom: none; }
.stpm-task-card:hover { background: #fafbf9; }
.stpm-task-card.is-completed .stpm-task-title {
	text-decoration: line-through;
	color: var(--stpm-text-muted);
}
.stpm-checkbox {
	width: 21px;
	height: 21px;
	border-radius: 50%;
	border: 1.8px solid #c6ccc8;
	flex-shrink: 0;
	margin-top: 1px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: #fff;
	padding: 0;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.stpm-checkbox:hover { border-color: var(--stpm-green); }
.stpm-checkbox.is-checked {
	background: var(--stpm-green);
	border-color: var(--stpm-green);
}
.stpm-task-body { flex: 1; min-width: 0; }
.stpm-task-title { font-size: 14px; font-weight: 550; line-height: 1.4; margin: 0 0 6px; word-break: break-word; }
.stpm-task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stpm-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	line-height: 1.5;
}
.stpm-badge-high { background: var(--stpm-red-soft); color: var(--stpm-red); }
.stpm-badge-medium { background: var(--stpm-orange-soft); color: var(--stpm-orange); }
.stpm-badge-low { background: var(--stpm-green-soft); color: var(--stpm-green); }
.stpm-badge-project {
	background: var(--stpm-bg);
	color: var(--stpm-text-muted);
	border: 1px solid var(--stpm-border);
}
.stpm-badge-overdue { background: var(--stpm-red-soft); color: var(--stpm-red); }
.stpm-task-card.is-overdue { box-shadow: inset 3px 0 0 var(--stpm-red); }
.stpm-task-card.is-overdue.is-completed { box-shadow: none; }
.stpm-reschedule-btn {
	background: none;
	border: none;
	color: var(--stpm-primary);
	font-size: 12px;
	font-weight: 550;
	font-family: inherit;
	cursor: pointer;
	padding: 7px 0 0;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.stpm-reschedule-btn:hover { text-decoration: underline; }
.stpm-task-time { font-size: 11px; color: var(--stpm-text-muted); }
.stpm-task-menu-btn {
	background: none;
	border: none;
	font-size: 18px;
	color: var(--stpm-text-muted);
	cursor: pointer;
	padding: 0 4px;
	flex-shrink: 0;
}
.stpm-task-menu {
	position: absolute;
	background: var(--stpm-card);
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(0,0,0,0.15);
	overflow: hidden;
	z-index: 40;
	min-width: 120px;
}
.stpm-task-menu button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 14px;
	background: none;
	border: none;
	font-size: 13px;
	cursor: pointer;
}
.stpm-task-menu button:hover { background: var(--stpm-bg); }
.stpm-task-menu button.is-danger { color: var(--stpm-red); }

/* ---------- Routine ---------- */
.stpm-routine-datebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.stpm-routine-datebar-mid {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}
.stpm-routine-datebar-mid strong { font-size: 14px; }
.stpm-streak-card {
	background: var(--stpm-orange-soft);
	border: 1px solid #e8d6b2;
	color: #7d4f0d;
	border-radius: var(--stpm-radius);
	padding: 13px 15px;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}
.stpm-streak-flame {
	width: 36px;
	height: 36px;
	border-radius: var(--stpm-radius-sm);
	background: #eee0c4;
	color: var(--stpm-orange);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.stpm-streak-body { display: flex; flex-direction: column; gap: 2px; }
.stpm-streak-value { font-family: var(--stpm-display); font-size: 16px; font-weight: 600; letter-spacing: -0.018em; }
.stpm-streak-sub { font-size: 12px; color: #8a6224; }
.stpm-routine-hint {
	font-size: 11px;
	color: var(--stpm-text-muted);
	line-height: 1.5;
	margin: 14px 2px 0;
}
.stpm-routine-list {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	overflow: hidden;
}
.stpm-routine-list:empty { display: none; }
.stpm-routine-card {
	padding: 11px 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid var(--stpm-border);
	transition: background-color 0.13s ease;
}
.stpm-routine-card:last-child { border-bottom: none; }
.stpm-routine-card:hover { background: #fafbf9; }
.stpm-routine-icon {
	width: 34px;
	height: 34px;
	border-radius: var(--stpm-radius-sm);
	background: var(--stpm-primary-soft);
	color: var(--stpm-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.stpm-routine-body { flex: 1; }
.stpm-routine-title { font-size: 14px; font-weight: 600; margin: 0; }
.stpm-routine-time { font-size: 12px; color: var(--stpm-text-muted); }
.stpm-routine-card.is-completed .stpm-routine-title { text-decoration: line-through; color: var(--stpm-text-muted); }
.stpm-routine-check {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1.8px solid #cbd0e0;
	background: transparent;
	cursor: pointer;
	color: #fff;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.stpm-routine-check.is-checked { background: var(--stpm-green); border-color: var(--stpm-green); }
.stpm-routine-delete {
	background: none;
	border: none;
	color: var(--stpm-text-muted);
	font-size: 16px;
	cursor: pointer;
}

/* ---------- Calendar ---------- */
.stpm-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.stpm-calendar-header h3 { margin: 0; font-family: var(--stpm-display); font-size: 15px; font-weight: 600; letter-spacing: -0.018em; }
.stpm-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 3px;
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	padding: 12px;
	margin-bottom: 14px;
}
.stpm-cal-dow {
	text-align: center;
	font-size: 11px;
	color: var(--stpm-text-muted);
	font-weight: 700;
	padding-bottom: 6px;
}
.stpm-cal-day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	border-radius: 10px;
	font-size: 13px;
	cursor: pointer;
	color: var(--stpm-text);
}
.stpm-cal-day.is-empty { cursor: default; }
.stpm-cal-day.is-today { background: var(--stpm-bg); font-weight: 700; }
.stpm-cal-day.is-selected { background: var(--stpm-primary); color: #fff; }
.stpm-cal-day.has-deadline::after {
	content: "";
	position: absolute;
	bottom: 4px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--stpm-red);
}
.stpm-cal-day.is-selected.has-deadline::after { background: #fff; }

/* ---------- Chart card ---------- */
.stpm-chart-card {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	padding: 16px;
	margin-bottom: 14px;
}

/* ---------- Profile ---------- */
.stpm-profile-header { text-align: center; padding: 10px 0 16px; }
.stpm-profile-avatar {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: var(--stpm-shadow);
	margin-bottom: 10px;
}
.stpm-profile-header h2 { margin: 0 0 4px; font-family: var(--stpm-display); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.stpm-profile-tagline { margin: 0; font-size: 13px; color: var(--stpm-text-muted); }
.stpm-menu-list {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: var(--stpm-radius);
	overflow: hidden;
}
.stpm-menu-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 13px 15px;
	background: none;
	border: none;
	border-bottom: 1px solid var(--stpm-border);
	text-align: left;
	font-size: 14px;
	font-family: inherit;
	color: var(--stpm-text);
	cursor: pointer;
	text-decoration: none;
}
.stpm-menu-item:hover { background: var(--stpm-bg); }
.stpm-menu-label { display: inline-flex; align-items: center; gap: 11px; color: inherit; }
.stpm-menu-item > .stpm-ico { color: var(--stpm-text-muted); }
.stpm-menu-item:last-child { border-bottom: none; }
.stpm-menu-item span { color: var(--stpm-text-muted); }
.stpm-menu-item-danger { color: var(--stpm-red); }
.stpm-install-label { color: var(--stpm-primary) !important; font-weight: 600; }

/* ---------- Date filter (Tasks tab) ---------- */
.stpm-date-filter {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 10px;
	flex-wrap: wrap;
}
.stpm-date-chip {
	background: var(--stpm-card);
	border: 1px solid var(--stpm-border);
	border-radius: 20px;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--stpm-text-muted);
	cursor: pointer;
	white-space: nowrap;
}
.stpm-date-chip.is-active {
	background: var(--stpm-primary);
	border-color: var(--stpm-primary);
	color: #fff;
}
.stpm-date-input {
	border: 1px solid var(--stpm-border);
	border-radius: 20px;
	padding: 6px 12px;
	font-size: 12px;
	background: var(--stpm-card);
	color: var(--stpm-text);
	font-family: inherit;
}

/* ---------- Bottom nav (mobile) ---------- */
.stpm-bottom-nav {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--stpm-card);
	display: flex;
	justify-content: space-between;
	padding: 8px 2px calc(8px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
}
.stpm-side-nav { display: none; }
.stpm-nav-item {
	background: none;
	border: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	font-size: 9px;
	color: var(--stpm-text-muted);
	cursor: pointer;
	padding: 4px 2px;
	flex: 1;
	min-width: 0;
	line-height: 1.2;
}
.stpm-nav-item > span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}
.stpm-nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.stpm-nav-item.is-active { color: var(--stpm-primary); }

/* ---------- Modals ---------- */
.stpm-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: flex-end;
	justify-content: center;
	z-index: 1000;
}
.stpm-modal.is-open { display: flex; }
.stpm-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 17, 23, 0.5);
}
.stpm-modal-panel {
	position: relative;
	background: var(--stpm-card);
	width: 100%;
	max-width: 480px;
	border-radius: 20px 20px 0 0;
	padding: 18px 20px 24px;
	max-height: 85vh;
	overflow-y: auto;
	animation: stpm-slide-up 0.2s ease;
}
@keyframes stpm-slide-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
.stpm-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.stpm-modal-header h3 { margin: 0; font-family: var(--stpm-display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.stpm-modal-body { font-size: 14px; color: var(--stpm-text-muted); line-height: 1.6; }

/* ---------- Forms ---------- */
.stpm-form { display: flex; flex-direction: column; gap: 14px; }
.stpm-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.stpm-field input,
.stpm-field select,
.stpm-field textarea {
	font-family: var(--stpm-sans);
	border: 1px solid var(--stpm-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 400;
	font-family: inherit;
	background: #fff;
	color: var(--stpm-text);
}
.stpm-field-row { display: flex; gap: 12px; }
.stpm-field-row .stpm-field { flex: 1; }
.stpm-priority-select { display: flex; gap: 8px; }
.stpm-priority-opt {
	flex: 1;
	border: 1px solid var(--stpm-border);
	background: #fff;
	border-radius: 10px;
	padding: 9px 0;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}
.stpm-priority-opt.is-active.stpm-priority-high { background: var(--stpm-red-soft); border-color: var(--stpm-red); color: var(--stpm-red); }
.stpm-priority-opt.is-active.stpm-priority-medium { background: var(--stpm-orange-soft); border-color: var(--stpm-orange); color: var(--stpm-orange); }
.stpm-priority-opt.is-active.stpm-priority-low { background: var(--stpm-green-soft); border-color: var(--stpm-green); color: var(--stpm-green); }

/* ---------- Recurrence controls ---------- */
.stpm-weekday-select { display: flex; gap: 5px; }
.stpm-weekday {
	flex: 1;
	border: 1px solid var(--stpm-border);
	background: #fff;
	border-radius: 8px;
	padding: 8px 0;
	font-size: 11px;
	font-weight: 700;
	color: var(--stpm-text-muted);
	cursor: pointer;
}
.stpm-weekday.is-active {
	background: var(--stpm-primary);
	border-color: var(--stpm-primary);
	color: #fff;
}
.stpm-badge-repeat {
	background: var(--stpm-primary-soft);
	color: var(--stpm-primary);
}

/* ---------- Toast ---------- */
.stpm-toast {
	position: absolute;
	bottom: 90px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #1a201f;
	color: #fff;
	padding: 10px 18px;
	border-radius: 30px;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 1100;
	white-space: nowrap;
}
.stpm-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---------- Login notice ---------- */
.stpm-login-notice {
	max-width: 480px;
	margin: 0 auto;
	text-align: center;
	background: #fff;
	border-radius: 16px;
	padding: 40px 20px;
	box-shadow: 0 4px 20px rgba(31, 36, 48, 0.06);
}

/* ---------- Desktop layout ---------- */
@media (min-width: 900px) {
	.stpm-app {
		max-width: 1060px;
		display: grid;
		grid-template-columns: 216px 1fr;
		grid-template-rows: auto 1fr;
		min-height: 700px;
	}
	.stpm-topbar {
		grid-column: 2;
		padding: 26px 32px 14px;
		border-bottom: 1px solid var(--stpm-border);
		margin-bottom: 4px;
	}
	.stpm-topbar-title { font-size: 22px; letter-spacing: -0.02em; }
	.stpm-views {
		grid-column: 2;
		padding: 22px 32px 40px;
		/* The view area scrolls on its own so the sidebar stays put and the
		   page doesn't end in a large empty gap on short content. */
		overflow-y: auto;
		max-height: calc(100vh - 140px);
	}
	.stpm-bottom-nav { display: none; }

	.stpm-side-nav {
		grid-column: 1;
		grid-row: 1 / span 2;
		display: flex;
		flex-direction: column;
		/* align-items:flex-start + no flex-grow on children is what keeps
		   the items packed at the top. Without this the mobile rule
		   `.stpm-nav-item { flex: 1 }` makes every item stretch to share
		   the full column height, leaving huge gaps between them. */
		align-items: stretch;
		justify-content: flex-start;
		gap: 2px;
		background: var(--stpm-card);
		padding: 22px 12px;
		border-right: 1px solid var(--stpm-border);
	}
	.stpm-side-nav .stpm-nav-item {
		flex: 0 0 auto;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		gap: 11px;
		font-size: 14px;
		font-weight: 500;
		padding: 9px 12px;
		border-radius: var(--stpm-radius-sm);
		width: 100%;
		min-width: 0;
		color: var(--stpm-text-soft);
		line-height: 1.4;
	}
	.stpm-side-nav .stpm-nav-item:hover {
		background: var(--stpm-bg);
		color: var(--stpm-text);
	}
	.stpm-side-nav .stpm-nav-item.is-active {
		background: var(--stpm-primary-soft);
		color: var(--stpm-primary);
		font-weight: 600;
	}
	.stpm-side-nav .stpm-nav-icon { font-size: 0; }

	.stpm-projects-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
	/* A full-bleed primary button reads as a banner at this width; size it
	   to its content so the hero stays the loudest element on the page. */
	.stpm-btn-block { width: auto; align-self: flex-start; }
	.stpm-view[data-view="home"] { display: none; }
	.stpm-view[data-view="home"].is-active { display: flex; flex-direction: column; align-items: stretch; }
	.stpm-modal-panel { border-radius: 18px; max-width: 460px; }
	.stpm-modal { align-items: center; }
	.stpm-toast { bottom: 28px; }
}
