:root {
	--brand: #c41e3a;
	--brand-dark: #8f1026;
	--brand-soft: rgba(196, 30, 58, 0.12);
	--ink: #1c1917;
	--muted: #57534e;
	--line: #e7e5e4;
	--paper: #faf7f5;
	--surface: #ffffff;
	--ok: #166534;
	--ok-bg: #dcfce7;
	--warn-bg: #fff7ed;
	--shadow: 0 18px 50px rgba(28, 25, 23, 0.12);
	--radius: 18px;
	--font: "Sora", "Segoe UI", sans-serif;
	--display: "Fraunces", Georgia, serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	font-family: var(--font);
	color: var(--ink);
	background: var(--paper);
}

body {
	background:
		radial-gradient(1200px 600px at 10% -10%, rgba(196, 30, 58, 0.18), transparent 55%),
		radial-gradient(900px 500px at 100% 0%, rgba(15, 118, 110, 0.12), transparent 50%),
		linear-gradient(180deg, #fff8f6 0%, #f4f1ee 45%, #efeae6 100%);
	background-attachment: fixed;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	height: auto;
}

.app-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.app-main {
	width: min(1100px, calc(100% - 2rem));
	margin: 0 auto;
	padding: 1.25rem 0 3rem;
	flex: 1;
}

/* Topbar */
.app-topbar {
	position: sticky;
	top: 0;
	z-index: 40;
	backdrop-filter: blur(14px);
	background: rgba(255, 252, 250, 0.86);
	border-bottom: 1px solid rgba(231, 229, 228, 0.9);
}

.app-topbar__inner {
	width: min(1100px, calc(100% - 2rem));
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
}

.app-brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.app-brand img {
	width: 132px;
	height: auto;
	display: block;
}

.app-brand__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.app-brand__text strong {
	font-family: var(--display);
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.app-brand__text span {
	font-size: 0.78rem;
	color: var(--muted);
}

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

.app-user__meta {
	text-align: right;
	line-height: 1.25;
}

.app-user__meta strong {
	display: block;
	font-size: 0.92rem;
}

.app-user__meta span {
	font-size: 0.75rem;
	color: var(--muted);
}

.app-menu {
	position: relative;
}

.app-menu summary {
	list-style: none;
	cursor: pointer;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: 999px;
	padding: 0.55rem 0.9rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.app-menu summary::-webkit-details-marker {
	display: none;
}

.app-menu__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 0.5rem);
	min-width: 220px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow);
	padding: 0.4rem;
	animation: rise 0.25s ease;
}

.app-menu__panel a,
.app-menu__panel button {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	padding: 0.7rem 0.85rem;
	border-radius: 10px;
	font: inherit;
	cursor: pointer;
	color: var(--ink);
}

.app-menu__panel a:hover,
.app-menu__panel button:hover {
	background: var(--brand-soft);
	color: var(--brand-dark);
}

.app-menu__divider {
	height: 1px;
	background: var(--line);
	margin: 0.35rem 0.4rem;
}

/* Cards / sections */
.panel {
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(231, 229, 228, 0.95);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.35rem;
	animation: rise 0.45s ease both;
}

.panel + .panel {
	margin-top: 1rem;
}

.panel__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.panel__head h1,
.panel__head h2 {
	margin: 0;
	font-family: var(--display);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.panel__head h1 {
	font-size: clamp(1.5rem, 3vw, 2rem);
}

.panel__head h2 {
	font-size: 1.2rem;
}

.panel__head p,
.muted {
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.flash {
	border-radius: 14px;
	padding: 0.9rem 1rem;
	margin-bottom: 1rem;
	background: var(--ok-bg);
	color: var(--ok);
	border: 1px solid #bbf7d0;
	animation: rise 0.35s ease;
}

.flash--error {
	background: #fef2f2;
	color: #991b1b;
	border-color: #fecaca;
}

/* Persona */
.person-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
}

.person-item {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 0.9rem 1rem;
}

.person-item span {
	display: block;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
	margin-bottom: 0.25rem;
}

.person-item strong {
	font-size: 1.05rem;
}

/* Humand section */
.panel--humand {
	border: 2px solid #93c5fd;
	background:
		radial-gradient(900px 220px at 0% 0%, rgba(37, 99, 235, 0.16), transparent 55%),
		radial-gradient(700px 200px at 100% 100%, rgba(14, 165, 233, 0.12), transparent 50%),
		#eff6ff;
	box-shadow: 0 18px 40px rgba(37, 99, 235, 0.16);
	position: relative;
	overflow: hidden;
}

.panel--humand::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 8px;
	background: linear-gradient(180deg, #2563eb, #0ea5e9);
}

.panel--humand .panel__head {
	margin-bottom: 0.85rem;
	padding-left: 0.35rem;
}

.humand-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.1rem 1.5rem;
	padding-left: 0.45rem;
}

.humand-banner__logo {
	height: 40px;
	width: auto;
	display: block;
	flex-shrink: 0;
}

.humand-banner__copy {
	flex: 1 1 240px;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.humand-banner__copy strong {
	display: block;
	font-size: 1.15rem;
	line-height: 1.25;
	color: #1e3a8a;
}

.humand-banner__copy span {
	display: block;
	font-size: 0.95rem;
	color: #334155;
}

.humand-banner__cta {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: 0.85rem 1.25rem;
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	color: #fff !important;
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
	transition: transform 0.18s ease;
}

.humand-banner__cta:hover {
	transform: translateY(-1px);
}

@media (max-width: 520px) {
	.humand-banner__cta {
		width: 100%;
	}
}

/* Toast */
.toast {
	position: fixed;
	left: 50%;
	bottom: 1.4rem;
	transform: translateX(-50%) translateY(16px);
	z-index: 80;
	min-width: min(420px, calc(100vw - 2rem));
	max-width: calc(100vw - 2rem);
	padding: 0.95rem 1.15rem;
	border-radius: 14px;
	background: #166534;
	color: #fff;
	font-weight: 600;
	box-shadow: 0 16px 40px rgba(22, 101, 52, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.toast--error {
	background: #991b1b;
	box-shadow: 0 16px 40px rgba(153, 27, 27, 0.35);
}

.btn__spinner {
	display: none;
	width: 1.05rem;
	height: 1.05rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

.btn--loading .btn__label {
	display: none;
}

.btn--loading .btn__spinner {
	display: inline-block;
}

.btn--loading {
	opacity: 0.85;
	cursor: wait;
	min-width: 10rem;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Semanas */
.week {
	margin-top: 1rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	animation: rise 0.5s ease both;
}

.week:nth-child(2) {
	animation-delay: 0.08s;
}

.week__label {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	align-items: center;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.week--current .week__label {
	background: linear-gradient(90deg, var(--brand), var(--brand-dark));
	color: #fff;
}

.week--next .week__label {
	background: #0f766e;
	color: #fff;
}

.week__days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day {
	min-height: 110px;
	padding: 0.75rem;
	border-right: 1px solid var(--line);
	border-top: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.day:last-child {
	border-right: 0;
}

.day__name {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
	font-weight: 600;
}

.day__shift {
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.35;
	word-break: break-word;
}

.empty-state {
	padding: 1.25rem;
	border-radius: 14px;
	background: var(--warn-bg);
	border: 1px solid #fed7aa;
	color: #9a3412;
}

/* Forms */
.form-stack {
	display: grid;
	gap: 0.9rem;
	max-width: 420px;
}

.form-stack--wide {
	max-width: none;
	width: 100%;
}

.form-stack label {
	display: grid;
	gap: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.form-stack input,
.form-stack textarea,
.form-stack select {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 0.8rem 0.9rem;
	font: inherit;
	background: #fff;
	color: var(--ink);
}

.form-stack textarea {
	min-height: 140px;
	resize: vertical;
}

.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus {
	outline: 2px solid rgba(196, 30, 58, 0.25);
	border-color: var(--brand);
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.25rem;
}

.btn {
	appearance: none;
	border: 0;
	border-radius: 999px;
	padding: 0.8rem 1.2rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn-primary {
	background: linear-gradient(135deg, var(--brand), var(--brand-dark));
	color: #fff;
	box-shadow: 0 10px 24px rgba(196, 30, 58, 0.28);
}

.btn-secondary {
	background: #fff;
	color: var(--ink);
	border: 1px solid var(--line);
}

.app-footer {
	padding: 1.25rem;
	text-align: center;
	color: var(--muted);
	font-size: 0.8rem;
}

/* Login */
.login-page {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 1.5rem;
}

.login-card {
	width: min(420px, 100%);
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 28px;
	box-shadow: var(--shadow);
	padding: 2rem 1.6rem 1.6rem;
	animation: rise 0.55s ease both;
}

.login-card__brand {
	text-align: center;
	margin-bottom: 1.5rem;
}

.login-card__brand img {
	width: 180px;
	margin: 0 auto 1rem;
	display: block;
	animation: floaty 4.5s ease-in-out infinite;
}

.login-card__brand h1 {
	margin: 0;
	font-family: var(--display);
	font-size: clamp(1.7rem, 4vw, 2.1rem);
	letter-spacing: -0.03em;
}

.login-card__brand p {
	margin: 0.45rem 0 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.login-hint {
	margin-top: 1rem;
	font-size: 0.8rem;
	color: var(--muted);
	line-height: 1.45;
	text-align: center;
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes floaty {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}

@media (max-width: 860px) {
	.week__days {
		grid-template-columns: 1fr 1fr;
	}

	.day {
		border-right: 0;
		min-height: auto;
	}

	.app-brand__text {
		display: none;
	}

	.person-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.week__days {
		grid-template-columns: 1fr;
	}

	.app-user__meta {
		display: none;
	}
}
