/* ============================================
   Nord CSS Variables (light defaults)
   ============================================ */
:root {
	--nord0: #2E3440;
	--nord1: #3B4252;
	--nord2: #434C5E;
	--nord3: #4C566A;
	--nord4: #D8DEE9;
	--nord5: #E5E9F0;
	--nord6: #ECEFF4;
	--nord7: #8FBCBB;
	--nord8: #88C0D0;
	--nord9: #81A1C1;
	--nord10: #5E81AC;
	--nord11: #BF616A;
	--nord12: #D08770;
	--nord13: #EBCB8B;
	--nord14: #A3BE8C;
	--nord15: #B48EAD;
	--bg-elevated: #f6f8fb;
}

/* ============================================
   Theme Overrides
   ============================================ */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="auto"]  { color-scheme: light; }

:root[data-theme="dark"] {
	color-scheme: dark;
	--nord0: #ECEFF4;
	--nord1: #E5E9F0;
	--nord2: #D8DEE9;
	--nord3: #D8DEE9;
	--nord4: #4C566A;
	--nord5: #3B4252;
	--nord6: #2E3440;
	--bg-elevated: var(--nord5);
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] {
		color-scheme: dark;
		--nord0: #ECEFF4;
		--nord1: #E5E9F0;
		--nord2: #D8DEE9;
		--nord3: #D8DEE9;
		--nord4: #4C566A;
		--nord5: #3B4252;
		--nord6: #2E3440;
		--bg-elevated: var(--nord5);
	}
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
	background-color: var(--nord6);
	color: var(--nord0);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ============================================
   App Layout
   ============================================ */
.app-layout {
	display: flex;
	height: 100vh;
	overflow: hidden;
}

.app-layout > main {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--nord6);
}

/* ============================================
   Sidebar
   ============================================ */
aside {
	width: 16rem;
	flex-shrink: 0;
	background-color: var(--bg-elevated);
	border-right: 1px solid var(--nord4);
	display: flex;
	flex-direction: column;
}

.sidebar-header {
	padding: 0 1rem;
	border-bottom: 1px solid var(--nord4);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	height: 4.25rem;
}

.user-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.user-avatar {
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	background: linear-gradient(135deg, var(--nord10) 0%, var(--nord9) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: white;
}

.user-meta {
	flex: 1;
	min-width: 0;
}

.user-meta .user-name {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord0);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.user-meta .user-username {
	display: block;
	font-size: 0.75rem;
	color: var(--nord3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.logout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.375rem;
	border-radius: 0.5rem;
	color: var(--nord3);
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

.logout-btn:hover {
	background-color: var(--nord4);
	color: var(--nord0);
}

.logout-btn svg {
	width: 1rem;
	height: 1rem;
}

aside > nav {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Main nav views */
#sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

#sidebar-nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

#sidebar-nav li a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.75rem;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord3);
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

#sidebar-nav li a:hover,
#sidebar-nav li.active a {
	background-color: var(--nord4);
	color: var(--nord0);
	filter: none;
}

#sidebar-nav li a svg {
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
}

/* Sidebar sections (Labels, Projects) */
.sidebar-section {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.sidebar-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0.75rem;
	margin-bottom: 0.25rem;
}

.sidebar-section-header h2 {
	font-size: 0.75rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--nord3);
	margin: 0;
}

.sidebar-section-header button {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem;
	border-radius: 0.25rem;
	color: var(--nord3);
	background: none;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.sidebar-section-header button:hover {
	background-color: var(--nord4);
	color: var(--nord0);
}

.sidebar-section-header button svg {
	width: 0.875rem;
	height: 0.875rem;
}

/* Individual item rows (labels/projects) */
.item-row {
	display: flex;
	align-items: center;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord3);
	transition: background-color 0.15s, color 0.15s;
}

.item-row.active,
.item-row:hover {
	background-color: var(--nord4);
	color: var(--nord0);
}

.item-row > a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
	padding: 0.3rem 0.5rem 0.3rem 0.75rem;
	text-decoration: none;
	color: inherit;
	border-radius: 0.5rem;
}

.item-row > a span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.item-row > a svg {
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
}

.item-actions {
	display: none;
	align-items: center;
	gap: 0.25rem;
	flex-shrink: 0;
	padding-right: 0.375rem;
}

.item-row:hover .item-actions {
	display: flex;
}

.item-actions button {
	display: flex;
	align-items: center;
	padding: 0.125rem;
	border-radius: 0.25rem;
	color: var(--nord3);
	background: none;
	border: none;
	cursor: pointer;
	transition: color 0.15s;
}

.item-actions button:hover {
	color: var(--nord0);
}

.item-actions button svg {
	width: 0.75rem;
	height: 0.75rem;
}

/* Inline forms (create/edit label or project) */
.inline-form {
	padding: 0.5rem 0.75rem;
}

.inline-form form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.inline-form .form-actions {
	display: flex;
	gap: 0.25rem;
}

/* ============================================
   Mobile Sidebar Drawer
   ============================================ */
#sidebar-toggle {
	display: none;
}

#sidebar-toggle:checked ~ #sidebar-backdrop {
	display: block;
}

#sidebar-toggle:checked ~ aside {
	transform: translateX(0);
}

@media (max-width: 768px) {
	aside {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 40;
		transform: translateX(-100%);
		transition: transform 0.3s ease-in-out;
	}

	#sidebar-backdrop {
		display: none;
		position: fixed;
		inset: 0;
		background-color: rgba(46, 52, 64, 0.5);
		z-index: 30;
	}
}

@media (min-width: 769px) {
	#sidebar-toggle-label {
		display: none;
	}
}

/* ============================================
   Page Content Area
   ============================================ */
.page-content {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
	background: var(--bg-elevated);
	border-bottom: 1px solid var(--nord4);
	position: sticky;
	top: 0;
	z-index: 10;
	flex-shrink: 0;
	height: 4.25rem;
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.5rem;
	gap: 1.5rem;
	height: 100%;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 1;
	min-width: 0;
}

.mobile-menu-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.75rem;
	background: transparent;
	border: none;
	color: var(--nord3);
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.15s, color 0.15s;
}

.mobile-menu-btn:hover {
	background: rgba(216, 222, 233, 0.5);
	color: var(--nord0);
}

.mobile-menu-btn svg {
	width: 1.25rem;
	height: 1.25rem;
}

:root[data-theme="dark"] .mobile-menu-btn:hover {
	background: rgba(76, 86, 106, 0.6);
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] .mobile-menu-btn:hover {
		background: rgba(76, 86, 106, 0.6);
	}
}

@media (max-width: 768px) {
	.mobile-menu-btn {
		display: flex;
	}
}

.page-identity {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
}

.title-section {
	display: flex;
	align-items: center;
	gap: 0.875rem;
}

.page-icon {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.625rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(94, 129, 172, 0.2);
	color: white;
}

.page-icon svg {
	width: 1rem;
	height: 1rem;
}

.title-wrapper {
	flex: 1;
	min-width: 0;
}

.page-title {
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--nord0);
	letter-spacing: -0.02em;
	line-height: 1.2;
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	overflow: hidden;
	margin: 0;
}

.task-count {
	font-size: 1rem;
	font-weight: 500;
	color: var(--nord3);
	white-space: nowrap;
	margin-left: 5px;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.new-task-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 2.25rem;
	padding: 0 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: white;
	border: none;
	border-radius: 0.75rem;
	cursor: pointer;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(94, 129, 172, 0.25);
	background: none;
}

.new-task-btn svg {
	width: 1rem;
	height: 1rem;
	position: relative;
	z-index: 1;
}

.btn-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--nord10) 0%, var(--nord9) 100%);
	z-index: 0;
}

.new-task-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--nord9) 0%, var(--nord8) 100%);
	opacity: 0;
	z-index: 0;
	transition: opacity 0.15s;
}

.new-task-btn:hover::before {
	opacity: 1;
}

.btn-text {
	position: relative;
	z-index: 1;
}

.header-search-input {
	height: 2.25rem;
	padding: 0 1rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	border: none;
	font-family: inherit;
	text-decoration: none;
	transition: filter 0.15s;
}

.btn:hover { filter: brightness(0.95); }

.btn-primary  { background-color: var(--nord10); color: white; }
.btn-secondary { background-color: var(--nord5); color: var(--nord0); border: 1px solid var(--nord4); }
.btn-danger   { background-color: var(--nord11); color: white; }
.btn-sm       { padding: 0.25rem 0.625rem; font-size: 0.75rem; }

.btn svg { width: 0.875rem; height: 0.875rem; }

/* ============================================
   Form Elements
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
	display: block;
	width: 100%;
	padding: 0.375rem 0.625rem;
	font-size: 0.875rem;
	font-family: inherit;
	background-color: var(--nord5);
	border: 1px solid var(--nord4);
	border-radius: 0.5rem;
	color: var(--nord0);
	appearance: auto;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--nord10);
	box-shadow: 0 0 0 2px rgba(94, 129, 172, 0.2);
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.form-field label {
	display: block;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--nord3);
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.form-actions {
	display: flex;
	gap: 0.5rem;
	padding-top: 0.25rem;
}

.label-checkboxes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.label-checkboxes label {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 400;
	background-color: var(--nord6);
	border: 1px solid var(--nord4);
	cursor: pointer;
	color: var(--nord0);
}

.label-checkboxes label input[type="checkbox"] {
	display: inline;
	width: 0.875rem;
	height: 0.875rem;
	padding: 0;
}

/* Task form */
.task-form-container {
	flex-shrink: 0;
	padding: 1rem 1rem 0;
}

.task-form-card {
	padding: 0.75rem;
	border-radius: 0.5rem;
	max-width: 56rem;
	background-color: var(--nord5);
	border: 1px solid var(--nord4);
}

.task-form-card form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.task-form-card input,
.task-form-card textarea,
.task-form-card select {
	background-color: var(--nord6);
}

/* ============================================
   Task Checkbox
   ============================================ */
.task-checkbox {
	appearance: none;
	-webkit-appearance: none;
	width: 1rem;
	height: 1rem;
	min-width: 1rem;
	border-radius: 0.25rem;
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
}

.task-checkbox.priority-1 {
	border: 1px solid var(--nord11);
	background-color: color-mix(in srgb, var(--nord11) 20%, transparent);
}
.task-checkbox.priority-2 {
	border: 1px solid var(--nord12);
	background-color: color-mix(in srgb, var(--nord12) 20%, transparent);
}
.task-checkbox.priority-3 {
	border: 1px solid var(--nord3);
	background-color: color-mix(in srgb, var(--nord3) 20%, transparent);
}
.task-checkbox.priority-4 {
	border: 1px solid var(--nord9);
	background-color: color-mix(in srgb, var(--nord9) 20%, transparent);
}
.task-checkbox.priority-5 {
	border: 1px solid var(--nord8);
	background-color: color-mix(in srgb, var(--nord8) 20%, transparent);
}

:root[data-theme="dark"] .task-checkbox.priority-5 {
	border-color: var(--nord10);
	background-color: color-mix(in srgb, var(--nord10) 20%, transparent);
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] .task-checkbox.priority-5 {
		border-color: var(--nord10);
		background-color: color-mix(in srgb, var(--nord10) 20%, transparent);
	}
}

.task-checkbox:checked::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 0.75rem;
	height: 0.75rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

/* ============================================
   Task List
   ============================================ */
.task-list,
.task-list-grouped {
	list-style: none;
	padding: 0;
	margin: 0;
	max-width: 56rem;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.task-list-grouped {
	gap: 1rem;
}

.task-group {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.task-group ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.day-header {
	padding: 0.5rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--nord3);
	margin: 0;
}

.task-row {
	padding: 0.75rem;
	border-radius: 0.5rem;
	background: transparent;
	transition: background-color 0.15s;
	list-style: none;
}

.task-row:hover {
	background-color: var(--nord5);
}

.task-row-main {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.task-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.task-title-line {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.task-title-line > span {
	font-size: 0.875rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--nord0);
}

.task-title-line > span.done {
	text-decoration: line-through;
	color: var(--nord3);
}

.task-title-line > svg {
	width: 0.75rem;
	height: 0.75rem;
	flex-shrink: 0;
	color: var(--nord10);
}

.task-metadata {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.75rem;
	color: var(--nord3);
	overflow: hidden;
	white-space: nowrap;
	flex-wrap: nowrap;
}

.task-metadata span {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	white-space: nowrap;
}

.task-metadata svg {
	width: 0.75rem;
	height: 0.75rem;
	flex-shrink: 0;
}

.task-sep {
	color: var(--nord4);
	font-size: 0.25rem;
	line-height: 1;
	flex-shrink: 0;
}

.task-actions {
	display: none;
	align-items: center;
	gap: 0.25rem;
	flex-shrink: 0;
}

.task-row:hover .task-actions {
	display: flex;
}

.task-actions button {
	display: flex;
	align-items: center;
	padding: 0.25rem;
	border-radius: 0.25rem;
	color: var(--nord3);
	background: none;
	border: none;
	cursor: pointer;
	transition: color 0.15s;
}

.task-actions button:hover {
	color: var(--nord0);
}

.task-actions button svg {
	width: 1rem;
	height: 1rem;
}

.task-description {
	padding: 0.375rem 0 0 1.75rem;
	font-size: 0.75rem;
	color: var(--nord3);
	margin: 0;
}

/* Empty state: hidden when task rows exist */
#task-list-empty {
	display: none;
}

#task-list:not(:has(.task-row)) #task-list-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 1rem;
	text-align: center;
	gap: 1rem;
}

#task-list-empty svg {
	width: 4rem;
	height: 4rem;
	stroke-width: 1;
	color: var(--nord4);
}

#task-list-empty p {
	font-size: 0.875rem;
	color: var(--nord3);
	margin: 0;
}

@media (max-width: 768px) {
	.task-description { display: none; }
	.task-row { padding: 0.625rem; }
}

/* ============================================
   HTMX Indicators
   ============================================ */
.htmx-indicator { display: none; }

.htmx-request .htmx-indicator,
form.htmx-request .htmx-indicator { display: inline; }

@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ============================================
   Flash Message
   ============================================ */
#flash {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 50;
}

.flash-message {
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	border: 1px solid;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.flash-message p {
	font-size: 0.875rem;
	font-weight: 500;
	margin: 0;
}

.flash-success {
	background-color: rgba(163, 190, 140, 0.15);
	border-color: rgba(163, 190, 140, 0.4);
	color: var(--nord14);
}

.flash-error {
	background-color: rgba(191, 97, 106, 0.15);
	border-color: rgba(191, 97, 106, 0.4);
	color: var(--nord11);
}

.flash-info {
	background-color: rgba(136, 192, 208, 0.15);
	border-color: rgba(136, 192, 208, 0.4);
	color: var(--nord8);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.auth-card {
	width: 100%;
	max-width: 28rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.auth-logo { text-align: center; }

.auth-logo-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 0.75rem;
	background: linear-gradient(135deg, var(--nord10) 0%, var(--nord9) 100%);
	margin-bottom: 1rem;
}

.auth-logo-icon span {
	font-size: 1.125rem;
	font-weight: 700;
	color: white;
}

.auth-logo h1 {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--nord0);
	margin: 0 0 0.5rem;
}

.auth-logo p {
	font-size: 0.875rem;
	color: var(--nord3);
	margin: 0;
}

.auth-form-card {
	background-color: var(--nord5);
	border: 1px solid var(--nord4);
	border-radius: 0.75rem;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.auth-form-card form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.auth-form-card .form-field label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord0);
}

.auth-form-card input[type="email"],
.auth-form-card input[type="password"],
.auth-form-card input[type="text"] {
	background-color: var(--nord6);
}

.form-error {
	padding: 0.75rem;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	background-color: rgba(191, 97, 106, 0.15);
	border: 1px solid rgba(191, 97, 106, 0.4);
	color: var(--nord11);
	margin: 0;
}

.auth-links {
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.auth-links p {
	font-size: 0.875rem;
	color: var(--nord3);
	margin: 0;
}

.auth-links a {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord10);
	text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

/* Auth success pages */
.auth-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	background-color: rgba(94, 129, 172, 0.15);
	margin-bottom: 1rem;
}

.auth-success-icon svg {
	width: 2rem;
	height: 2rem;
	color: var(--nord10);
}

.warning-box {
	padding: 1rem;
	border-radius: 0.5rem;
	background-color: rgba(191, 97, 106, 0.1);
	border: 1px solid rgba(191, 97, 106, 0.3);
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.warning-box svg {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
	margin-top: 0.125rem;
	color: var(--nord11);
}

.warning-box p {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--nord0);
	margin: 0;
}

.reset-key-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.reset-key-field label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord0);
}

.reset-key-field input {
	font-family: monospace;
	background-color: var(--nord6);
}

.reset-key-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.reset-key-actions .btn {
	flex: 1 1 auto;
	justify-content: center;
}

.reset-key-confirm {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--nord0);
	display: flex;
}

.reset-key-confirm label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}

.reset-key-confirm input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 0.2rem;
}

.reset-key-continue {
	width: 100%;
	justify-content: center;
}

.reset-key-continue[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
}

.reset-key-feedback {
	min-height: 1.25rem;
	font-size: 0.8125rem;
	color: var(--nord10);
	text-align: center;
}

/* ============================================
   Settings Page
   ============================================ */
.settings-content {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
}

.settings-sections {
	max-width: 56rem;
	display: flex;
	flex-direction: column;
}

.settings-section {
	padding-bottom: 1.5rem;
}

.settings-section + .settings-section {
	padding-top: 1.5rem;
	border-top: 1px solid var(--nord4);
}

.settings-section h2 {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--nord0);
	margin: 0 0 0.25rem;
}

.settings-section > p {
	font-size: 0.75rem;
	color: var(--nord3);
	margin: 0 0 0.75rem;
}

.settings-section-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.settings-section-header > div h2 { margin-bottom: 0.25rem; }
.settings-section-header > div p  { margin: 0; }

.settings-form-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.settings-form-row select { flex: 1; }

.password-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.password-form-grid {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 640px) {
	.password-form-grid {
		grid-template-columns: 1fr 1fr;
	}
	.full-width { grid-column: 1 / -1; }
}

.action-row {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: center;
}

.import-form {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.import-form input[type="file"] {
	width: auto;
	font-size: 0.75rem;
	background: none;
	border: none;
	padding: 0;
	color: var(--nord0);
	box-shadow: none;
}

.import-form input[type="file"]:focus {
	box-shadow: none;
}

.pat-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.pat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	border-radius: 0.5rem;
	background-color: var(--nord6);
	border: 1px solid var(--nord4);
	transition: border-color 0.15s;
	gap: 0.75rem;
}

.pat-item:hover { border-color: var(--nord10); }

.pat-info {
	flex: 1;
	min-width: 0;
}

.pat-info strong {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nord0);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pat-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.75rem;
	color: var(--nord3);
	margin-top: 0.25rem;
	flex-wrap: wrap;
}

.pat-form {
	padding: 1rem;
	border-radius: 0.5rem;
	background-color: var(--nord6);
	border: 1px solid var(--nord4);
	margin-bottom: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.pat-form input { background-color: var(--nord5); }

.pat-form-grid {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 640px) {
	.pat-form-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   Search
   ============================================ */
.search-count {
	font-size: 0.875rem;
	color: var(--nord3);
	margin: 0 0 0.75rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
	.header-container {
		padding: 0.875rem 1rem;
		flex-wrap: wrap;
	}

	.page-title    { font-size: 1.125rem; }
	.task-count    { font-size: 0.875rem; }
	.page-icon     { width: 2rem; height: 2rem; }

	.new-task-btn {
		padding: 0.625rem;
		width: 2.75rem;
		height: 2.75rem;
	}

	.btn-text { display: none; }
}

@media (max-width: 480px) {
	.task-count { display: none; }
}
