* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	color-scheme: dark;
	--bg: #050a07;
	--bg-soft: #0b1410;
	--glass: rgba(255, 255, 255, 0.05);
	--glass-strong: rgba(255, 255, 255, 0.08);
	--border: rgba(255, 255, 255, 0.08);
	--border-strong: rgba(255, 255, 255, 0.16);
	--text: #ecf7f0;
	--text-dim: #8ba396;
	--accent: #00e676;
	--accent-2: #00e5ff;
	--accent-fg: #041a0f;
	--pink: #ec4899;
	--green: #10b981;
	--red: #ff3d71;
	--glow-accent: 0 0 24px rgba(0, 230, 118, 0.45);
	--shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
	--radius: 18px;
	--radius-sm: 12px;
}

[data-theme="light"] {
	--bg: #eef6f1;
	--bg-soft: #ffffff;
	--glass: rgba(255, 255, 255, 0.72);
	--glass-strong: rgba(255, 255, 255, 0.9);
	--border: rgba(10, 40, 20, 0.08);
	--border-strong: rgba(10, 40, 20, 0.16);
	--text: #0d1f14;
	--text-dim: #557064;
	--shadow: 0 4px 20px rgba(10, 40, 20, 0.08);
	--glow-accent: 0 8px 30px rgba(0, 230, 118, 0.25);
}

html,
body {
	min-height: 100%;
}
body {
	font-family:
		"Inter",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	transition:
		background 0.3s,
		color 0.3s;
	overflow-x: hidden;
}

.bg-glow {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(700px 500px at 10% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
		radial-gradient(700px 500px at 90% 10%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 60%),
		radial-gradient(800px 600px at 50% 100%, rgba(236, 72, 153, 0.1), transparent 60%);
	animation: floatBg 25s ease-in-out infinite alternate;
}
[data-theme="light"] .bg-glow {
	background:
		radial-gradient(700px 500px at 10% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
		radial-gradient(700px 500px at 90% 10%, color-mix(in srgb, var(--accent-2) 15%, transparent), transparent 60%),
		radial-gradient(800px 600px at 50% 100%, rgba(236, 72, 153, 0.08), transparent 60%);
}
@keyframes floatBg {
	0% {
		transform: translate3d(0, 0, 0);
	}
	100% {
		transform: translate3d(0, -30px, 0);
	}
}

.glass {
	background: var(--glass);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid var(--border);
}
.muted {
	color: var(--text-dim);
	font-size: 13px;
}

/* Header */
.header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding: 14px 0;
}
.header-inner {
	width: 95%;
	max-width: 1600px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}
.logo {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	box-shadow: var(--glow-accent);
}
.logo i,
.logo svg {
	width: 22px;
	height: 22px;
}
.logo.big {
	width: 64px;
	height: 64px;
	border-radius: 20px;
	margin: 0 auto 12px;
}
.logo.big i,
.logo.big svg {
	width: 30px;
	height: 30px;
}
.brand h1 {
	font-size: 20px;
	font-weight: 800;
	line-height: 1;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
[data-theme="light"] .brand h1,
[data-theme="light"] .gauge-value {
	filter: brightness(0.8) saturate(1.15);
}
.brand p {
	font-size: 12px;
	margin-top: 2px;
}

.search {
	flex: 1;
	min-width: 220px;
	max-width: 440px;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--glass-strong);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 10px 16px;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.search:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.search i,
.search svg {
	width: 18px;
	height: 18px;
	color: var(--text-dim);
	flex-shrink: 0;
}
.search input {
	flex: 1;
	background: transparent;
	border: 0;
	outline: 0;
	color: var(--text);
	font-size: 14px;
	font-family: inherit;
}
.search input::placeholder {
	color: var(--text-dim);
}
.header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

/* Buttons */
.icon-btn,
.primary-btn,
.ghost-btn {
	font-family: inherit;
	cursor: pointer;
	border: 0;
	transition:
		transform 0.15s,
		box-shadow 0.2s,
		background 0.2s,
		color 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}
.icon-btn {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--glass-strong);
	color: var(--text);
	border: 1px solid var(--border);
	justify-content: center;
}
.icon-btn:hover {
	border-color: var(--border-strong);
	transform: translateY(-1px);
}
.icon-btn i,
.icon-btn svg {
	width: 18px;
	height: 18px;
}
.icon-btn.danger:hover {
	color: var(--red);
	border-color: var(--red);
}

.primary-btn {
	padding: 10px 18px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 14px;
	color: var(--accent-fg);
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.primary-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 55%, transparent);
}
.primary-btn.full {
	width: 100%;
	justify-content: center;
	padding: 12px;
}
.primary-btn i,
.primary-btn svg {
	width: 16px;
	height: 16px;
}
.primary-btn.small,
.ghost-btn.small {
	padding: 8px 14px;
	font-size: 13px;
	border-radius: 10px;
}
.primary-btn.small i,
.primary-btn.small svg {
	width: 14px;
	height: 14px;
}
.primary-btn.danger {
	background: linear-gradient(135deg, var(--red), #f97316);
	color: #fff;
	box-shadow: 0 6px 20px rgba(255, 61, 113, 0.4);
}
.primary-btn.danger:hover {
	box-shadow: 0 10px 28px rgba(255, 61, 113, 0.55);
}

.ghost-btn {
	padding: 10px 18px;
	border-radius: 12px;
	background: transparent;
	color: var(--text-dim);
	border: 1px solid var(--border);
	font-weight: 500;
}
.ghost-btn:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

/* Layout */
main {
	width: 95%;
	max-width: 1600px;
	margin: 24px auto 0;
	padding-bottom: 120px; /* Respiro no final da página */
}
.section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 24px 0 16px;
}
.section-title h2 {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.3px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.section-title h2 i,
.section-title h2 svg {
	width: 18px;
	height: 18px;
	color: var(--accent);
}

/* Stats */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 20px;
}
.stat-card {
	padding: 18px;
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	gap: 14px;
	transition:
		transform 0.2s,
		box-shadow 0.2s;
}
.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}
.stat-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--c);
	color: var(--accent-fg);
	flex-shrink: 0;
	box-shadow: 0 0 20px color-mix(in srgb, var(--c) 40%, transparent);
}
.stat-icon i,
.stat-icon svg {
	width: 20px;
	height: 20px;
}
.stat-label {
	font-size: 12px;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.stat-value {
	display: block;
	font-size: 24px;
	font-weight: 800;
	margin-top: 2px;
}

/* Dashboard */
.dash-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin-bottom: 32px;
}
.dash-card {
	padding: 20px;
	border-radius: var(--radius);
	display: flex;
	flex-direction: column;
	gap: 14px;
	transition:
		transform 0.2s,
		box-shadow 0.2s;
}
.dash-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}
.dash-card.span-2 {
	grid-column: span 2;
}
.dash-head h3 {
	font-size: 13px;
	font-weight: 700;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.dash-head h3 i,
.dash-head h3 svg {
	width: 14px;
	height: 14px;
	color: var(--accent);
}

/* Gauge */
.gauge-wrap {
	position: relative;
	width: 160px;
	height: 160px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}
.gauge-wrap::before {
	content: "";
	position: absolute;
	inset: 10px;
	border-radius: 50%;
	box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 15%, transparent);
	pointer-events: none;
}
.gauge {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}
.gauge-bg {
	fill: none;
	stroke: var(--glass-strong);
	stroke-width: 10;
}
.gauge-fg {
	fill: none;
	stroke: url(#gaugeGrad);
	stroke-width: 10;
	stroke-linecap: round;
	stroke-dasharray: 327;
	stroke-dashoffset: 327;
	transition: stroke-dashoffset 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gauge-center {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 2px;
}
.gauge-value {
	font-size: 32px;
	font-weight: 800;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.gauge-sub {
	font-size: 12px;
	color: var(--text-dim);
	font-weight: 600;
}

/* Bars */
.bars {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.bar-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.bar-label {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	font-weight: 600;
}
.bar-label .name {
	color: var(--text);
}
.bar-label .count {
	color: var(--text-dim);
}
.bar-track {
	height: 8px;
	background: var(--glass-strong);
	border-radius: 999px;
	overflow: hidden;
}
.bar-fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent);
	transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-fill.pri-high {
	background: linear-gradient(90deg, var(--red), #f97316);
	box-shadow: 0 0 8px rgba(255, 61, 113, 0.5);
}
.bar-fill.pri-normal {
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.bar-fill.pri-low {
	background: linear-gradient(90deg, var(--accent-2), var(--green));
}

/* Tags */
.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tag-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	border: 1px solid;
	transition: transform 0.15s;
}
.tag-pill:hover {
	transform: translateY(-1px);
}
.tag-pill .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	box-shadow: 0 0 8px currentColor;
}
.tag-pill .count {
	opacity: 0.7;
	font-weight: 500;
	font-size: 11px;
}

/* Upcoming */
.upcoming-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.upcoming-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	background: var(--glass-strong);
	border-left: 3px solid var(--accent);
}
.upcoming-item .u-time {
	min-width: 66px;
	font-size: 12px;
	font-weight: 700;
	color: var(--text-dim);
	text-transform: uppercase;
}
.upcoming-item .u-title {
	flex: 1;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.upcoming-item .u-badge {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}
.upcoming-item.high {
	border-left-color: var(--red);
}
.upcoming-item.high .u-badge {
	background: var(--red);
}
.upcoming-item.normal .u-badge {
	background: var(--accent);
}
.upcoming-item.low {
	border-left-color: var(--accent-2);
}
.upcoming-item.low .u-badge {
	background: var(--accent-2);
}

/* Filters */
.filters-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 12px 6px 6px;
	border-radius: 999px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.filters {
	display: inline-flex;
	gap: 4px;
	flex-wrap: wrap;
}
.filter-btn {
	padding: 9px 18px;
	border-radius: 999px;
	background: transparent;
	border: 0;
	color: var(--text-dim);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}
.filter-btn:hover {
	color: var(--text);
}
.filter-btn.active {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tag-filter {
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	background: var(--glass-strong);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 8px 14px;
	cursor: pointer;
	outline: 0;
}
.tag-filter:focus {
	border-color: var(--accent);
}

/* Cards */
.appointments {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}
.card {
	padding: 18px;
	border-radius: var(--radius);
	border-left: 4px solid var(--accent);
	position: relative;
	overflow: hidden;
	transition:
		transform 0.25s,
		box-shadow 0.25s,
		border-color 0.25s,
		opacity 0.3s;
	animation: cardIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
	animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes cardIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
.card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 36px color-mix(in srgb, var(--accent) 25%, transparent);
	border-color: var(--accent);
}
.card.pri-high {
	border-left-color: var(--red);
}
.card.pri-normal {
	border-left-color: var(--accent);
}
.card.pri-low {
	border-left-color: var(--accent-2);
}
.card.pri-high:hover {
	box-shadow: 0 12px 36px rgba(255, 61, 113, 0.28);
	border-color: var(--red);
}
.card.pri-low:hover {
	box-shadow: 0 12px 36px color-mix(in srgb, var(--accent-2) 28%, transparent);
	border-color: var(--accent-2);
}
.card.done {
	opacity: 0.55;
}
.card.done .card-title {
	text-decoration: line-through;
}

.card-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}
.time-badge {
	display: flex;
	flex-direction: column;
	line-height: 1.1;
}
.time-badge .day {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--text-dim);
	font-weight: 600;
}
.time-badge .time {
	font-size: 22px;
	font-weight: 800;
	margin-top: 2px;
}
.time-badge.late .day {
	color: var(--red);
}
.time-badge.late .time {
	color: var(--red);
}

.card-actions {
	display: flex;
	gap: 4px;
}
.card-actions .icon-btn {
	width: 32px;
	height: 32px;
	border-radius: 9px;
}
.card-actions .icon-btn i,
.card-actions .icon-btn svg {
	width: 15px;
	height: 15px;
}

.card-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 6px;
	overflow-wrap: anywhere;
}
.card-desc {
	font-size: 13px;
	color: var(--text-dim);
	margin-bottom: 12px;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0;
}
.card-tags .tag-mini {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	border: 1px solid;
}
.card-tags .tag-mini .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	box-shadow: 0 0 6px currentColor;
}
.card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	flex-wrap: wrap;
}
.chip {
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--glass-strong);
	border: 1px solid var(--border);
	color: var(--text-dim);
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.pri-label {
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
}
.pri-label.pri-high {
	color: var(--red);
	background: rgba(255, 61, 113, 0.12);
}
.pri-label.pri-normal {
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.pri-label.pri-low {
	color: var(--accent-2);
	background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

/* Empty */
.empty {
	text-align: center;
	padding: 80px 20px;
}
.empty-icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 18px;
	border-radius: 24px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	box-shadow: var(--glow-accent);
}
.empty-icon i,
.empty-icon svg {
	width: 36px;
	height: 36px;
}
.empty h3 {
	font-size: 18px;
	margin-bottom: 6px;
}
.empty .primary-btn {
	margin-top: 20px;
}

/* Modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(6px);
	display: grid;
	place-items: center;
	padding: 20px;
	animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.modal {
	width: 100%;
	max-width: 520px;
	border-radius: 22px;
	padding: 24px;
	animation: modalIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
	max-height: 90vh;
	overflow-y: auto;
}

/* Força um fundo sólido e escuro para o modal no tema dark */
[data-theme="dark"] .modal {
	background: #0a100d;
	border: 1px solid rgba(255, 255, 255, 0.15);
	box-shadow:
		0 24px 64px rgba(0, 0, 0, 0.9),
		0 0 32px rgba(0, 230, 118, 0.1);
}

.form-group select option {
	background-color: var(--bg-soft);
	color: var(--text);
}
@keyframes modalIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 18px;
}
.modal-header h2 {
	font-size: 18px;
	font-weight: 700;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.form-row.single {
	grid-template-columns: 1fr;
}
.form-group label {
	font-size: 12px;
	font-weight: 600;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
	font-family: inherit;
	font-size: 14px;
	background: var(--glass-strong);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 11px 14px;
	color: var(--text);
	outline: 0;
	width: 100%;
	resize: vertical;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
	background: #fff;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

/* Fix: respeitar [hidden] mesmo com display custom */
.modal-overlay[hidden],
.form-group[hidden],
.form-row[hidden],
.inline-tag-form[hidden],
.tag-picker-empty[hidden] {
	display: none !important;
}

/* Tag picker */
.tag-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-height: 40px;
	padding: 8px;
	background: var(--glass-strong);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}
.tag-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid;
	cursor: pointer;
	user-select: none;
	transition: all 0.15s;
	opacity: 0.55;
}
.tag-check.on {
	opacity: 1;
	box-shadow: 0 0 10px currentColor;
}
.tag-check input {
	display: none;
}
.tag-check .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}
.tag-picker-empty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 4px;
}
.add-tag-btn {
	color: var(--accent) !important;
	border-color: var(--accent) !important;
	background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
	opacity: 1 !important;
	cursor: pointer;
	font-family: inherit;
}
.add-tag-btn:hover {
	background: color-mix(in srgb, var(--accent) 16%, transparent) !important;
}
.add-tag-btn i,
.add-tag-btn svg {
	width: 12px;
	height: 12px;
}

/* Inline tag form */
.inline-tag-form {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	align-items: center;
	animation: inlineIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes inlineIn {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.inline-tag-form input[type="text"] {
	flex: 1;
	font-family: inherit;
	font-size: 13px;
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--glass-strong);
	color: var(--text);
	border: 1px solid var(--border);
	outline: 0;
}
.inline-tag-form input[type="text"]:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.inline-tag-form input[type="color"] {
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: transparent;
	cursor: pointer;
}
@media (max-width: 480px) {
	.inline-tag-form {
		flex-wrap: wrap;
	}
	.inline-tag-form input[type="text"] {
		flex-basis: 100%;
	}
}

/* Tags list modal */
.tags-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 320px;
	overflow-y: auto;
}
.tag-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	background: var(--glass-strong);
}
.tag-row .tag-color {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	box-shadow: 0 0 10px currentColor;
}
.tag-row .tag-name {
	flex: 1;
	font-weight: 600;
	font-size: 14px;
}
.tag-row .tag-usage {
	font-size: 11px;
	color: var(--text-dim);
}
.tag-form {
	display: flex;
	gap: 8px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}
.tag-form input[type="text"] {
	flex: 1;
	font-family: inherit;
	font-size: 14px;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	background: var(--glass-strong);
	color: var(--text);
	border: 1px solid var(--border);
	outline: 0;
}
.tag-form input[type="color"] {
	width: 42px;
	height: 42px;
	padding: 0;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: transparent;
	cursor: pointer;
}
.tag-form .primary-btn {
	padding: 10px 14px;
}

/* Dialog */
.dialog-box {
	max-width: 440px;
	text-align: center;
	padding: 28px 24px;
}
.dialog-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	border-radius: 20px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	box-shadow: var(--glow-accent);
}
.dialog-icon.danger {
	background: linear-gradient(135deg, var(--red), #f97316);
	color: #fff;
	box-shadow: 0 0 24px rgba(255, 61, 113, 0.5);
}
.dialog-icon i,
.dialog-icon svg {
	width: 28px;
	height: 28px;
}
.dialog-box h2 {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 8px;
}
.dialog-box p {
	font-size: 14px;
	line-height: 1.55;
	color: var(--text-dim);
	overflow-wrap: anywhere;
	margin-bottom: 4px;
}
.dialog-box .form-actions {
	justify-content: center;
	margin-top: 22px;
}

/* FAB */
.fab {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 200;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	display: none;
	place-items: center;
	border: 0;
	cursor: pointer;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 55%, transparent);
	animation: pulse 2.4s ease-in-out infinite;
	transition: transform 0.2s;
}
.fab:hover {
	transform: scale(1.08);
}
.fab i,
.fab svg {
	width: 26px;
	height: 26px;
}
@keyframes pulse {
	0%,
	100% {
		box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 55%, transparent);
	}
	50% {
		box-shadow: 0 10px 40px color-mix(in srgb, var(--accent-2) 65%, transparent);
	}
}

/* Toasts */
.toast-container {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	pointer-events: none;
}
.toast {
	background: var(--glass-strong);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--border);
	padding: 12px 18px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: var(--shadow);
	opacity: 0;
	transform: translateY(16px);
	transition:
		opacity 0.25s,
		transform 0.25s;
	pointer-events: auto;
	max-width: 90vw;
}
.toast.show {
	opacity: 1;
	transform: translateY(0);
}
.toast-success {
	border-color: var(--accent);
}
.toast-error {
	border-color: var(--red);
}

/* Login / Setup */
.login-wrap {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 20px;
}
.login-card {
	width: 100%;
	max-width: 380px;
	padding: 32px;
	border-radius: 24px;
	text-align: center;
}
.login-card h1 {
	font-size: 22px;
	font-weight: 800;
	margin-bottom: 4px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.login-card form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 20px;
}
.login-card input {
	font-family: inherit;
	font-size: 14px;
	padding: 12px 16px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--glass-strong);
	color: var(--text);
	outline: 0;
	text-align: center;
}
.login-card input:focus {
	border-color: var(--accent);
}
.error {
	color: var(--red);
	font-size: 13px;
	margin-top: 12px;
}

/* Settings page */
.settings-main {
	width: 95%;
	max-width: 1600px;
	margin: 24px auto 0;
	padding-bottom: 100px; /* Respiro no final da página de configurações */
}
.settings-section {
	padding: 22px;
	border-radius: var(--radius);
	margin-bottom: 16px;
}
.settings-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--border);
}
.settings-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-fg);
	flex-shrink: 0;
	box-shadow: var(--glow-accent);
}
.settings-icon i,
.settings-icon svg {
	width: 20px;
	height: 20px;
}
.settings-head h2 {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 2px;
}
.settings-head p {
	font-size: 12px;
}
.settings-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}
.color-field {
	display: flex;
	gap: 8px;
}
.color-field input[type="color"] {
	width: 52px;
	height: 44px;
	padding: 0;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: transparent;
	cursor: pointer;
	flex-shrink: 0;
}
.color-field input[type="text"] {
	flex: 1;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 14px;
	letter-spacing: 0.5px;
}
.gradient-preview {
	height: 60px;
	border-radius: var(--radius-sm);
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
	transition:
		background 0.3s,
		box-shadow 0.3s;
}

/* Responsive */
@media (max-width: 900px) {
	.stats-grid,
	.dash-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.dash-card.span-2 {
		grid-column: span 2;
	}
}
@media (max-width: 640px) {
	.header-inner,
	main,
	.settings-main {
		width: 100%;
		padding-left: 16px;
		padding-right: 16px;
	}
	main {
		padding-bottom: 100px; /* Mantém o respiro no celular */
	}
	.settings-main {
		padding-bottom: 80px;
	}

	.header-inner {
		gap: 10px;
	}
	.brand h1 {
		font-size: 17px;
	}
	.brand p {
		display: none;
	}
	.search {
		order: 3;
		flex-basis: 100%;
		max-width: none;
	}
	.primary-btn span {
		display: none;
	}
	#newBtn {
		padding: 10px 12px;
		display: none;
	}
	.fab {
		display: grid;
	}
	.form-row {
		grid-template-columns: 1fr;
	}
	.appointments {
		grid-template-columns: 1fr;
	}
	.stats-grid,
	.dash-grid {
		grid-template-columns: 1fr;
	}
	.dash-card.span-2 {
		grid-column: span 1;
	}
	.filters-bar {
		border-radius: var(--radius);
	}
	.toast-container {
		bottom: 96px;
	}
	.settings-section {
		padding: 18px;
	}
}

/* ── Mini Calendário ── */
.mini-calendar {
	width: 100%;
}
.cal-header {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
}
.cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}
.cal-cell {
	aspect-ratio: 1;
	border-radius: 12px;
	background: var(--glass-strong);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid transparent;
	transition: all 0.2s;
	position: relative;
	cursor: default;
}
.cal-cell.empty {
	background: transparent;
}
.cal-cell.today {
	background: color-mix(in srgb, var(--accent) 15%, transparent);
	border-color: var(--accent);
	color: var(--accent);
	font-weight: 800;
	box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.cal-cell.has-events {
	background: color-mix(in srgb, var(--accent) 5%, var(--glass-strong));
	border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.cal-cell.has-events:hover {
	background: color-mix(in srgb, var(--accent) 12%, var(--glass-strong));
	transform: scale(1.05);
	z-index: 2;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.cal-date {
	margin-top: -4px;
}

/* Bolinhas de evento */
.cal-dots {
	display: flex;
	gap: 3px;
	position: absolute;
	bottom: 8px;
	justify-content: center;
	width: 100%;
}
.cal-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}
.cal-dot-more {
	font-size: 9px;
	font-weight: 800;
	color: var(--text-dim);
	line-height: 6px;
	margin-left: 2px;
}
.cal-cell.today .cal-dots {
	bottom: 8px;
}

/* Tooltip Elegante (CSS Puro) */
.cal-cell[data-tooltip]:hover::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-6px);
	background: var(--glass-strong);
	backdrop-filter: blur(10px);
	border: 1px solid var(--border-strong);
	color: var(--text);
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	animation: fadeInTooltip 0.2s forwards;
	z-index: 10;
	box-shadow: var(--shadow);
}
@keyframes fadeInTooltip {
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(-2px);
	}
}

@media (max-width: 480px) {
	.cal-grid {
		gap: 4px;
	}
	.cal-cell {
		border-radius: 8px;
		font-size: 12px;
	}
	.cal-dot {
		width: 4px;
		height: 4px;
	}
	.cal-dots {
		bottom: 5px;
	}
}
