/* =========================================================================
   Estudio Lenge — Portal de Clientes (maqueta)
   Mobile-first · autoconténido · acento verde Lenge
   No depende de app.css para evitar conflictos con el panel de administración.
   ========================================================================= */

:root {
	--bg: #f4f5f4;
	--surface: #ffffff;
	--surface-muted: #f4f4f5;
	--border: #e6e6e9;
	--border-strong: #d4d4d8;
	--fg: #18181b;
	--fg-muted: #71717a;
	--fg-subtle: #a1a1aa;

	--primary: #16a34a;
	--primary-hover: #15803d;
	--primary-soft: #ecfdf3;
	--primary-ink: #15803d;

	--radius: 0.9rem;
	--radius-sm: 0.55rem;
	--shadow-sm: 0 1px 2px 0 rgba(24, 24, 27, 0.05);
	--shadow-md: 0 6px 20px -6px rgba(24, 24, 27, 0.14), 0 2px 6px -3px rgba(24, 24, 27, 0.08);
	--shadow-lg: 0 18px 50px -12px rgba(24, 24, 27, 0.30);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
	font-size: 15px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 999px; }

/* ========================= Login ========================= */
.login {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 20px;
	background:
		radial-gradient(120% 90% at 50% -10%, #e9f9ef 0%, rgba(233,249,239,0) 55%),
		var(--bg);
}
.login__card {
	width: 100%;
	max-width: 400px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	padding: 30px 26px 26px;
}
.login__brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login__brand img { width: 176px; height: auto; }
.login__title { font-size: 20px; font-weight: 680; letter-spacing: -0.02em; text-align: center; margin: 2px 0 4px; }
.login__sub { text-align: center; color: var(--fg-muted); font-size: 13.5px; margin: 0 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--fg-subtle); }
.field input {
	width: 100%;
	height: 46px;
	padding: 0 14px 0 38px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-size: 15px;
	color: var(--fg);
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.14); }
.field input::placeholder { color: var(--fg-subtle); }

.login__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 12.5px; }
.login__row label { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-muted); cursor: pointer; }
.login__row a { color: var(--primary-ink); font-weight: 600; }

.btn-block {
	width: 100%;
	height: 48px;
	border: none;
	border-radius: var(--radius-sm);
	background: var(--primary);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: var(--shadow-sm);
	transition: background .15s;
}
.btn-block:hover { background: var(--primary-hover); }
.btn-block svg { width: 18px; height: 18px; }

.login__demo {
	margin-top: 16px;
	font-size: 12px;
	color: var(--fg-subtle);
	text-align: center;
	line-height: 1.5;
}
.login__foot { margin-top: 22px; font-size: 11.5px; color: var(--fg-subtle); text-align: center; }

/* ========================= App shell (portal) ========================= */
.shell {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}
.appbar {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255,255,255,0.9);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
}
.appbar img { height: 26px; width: auto; }
.appbar__spacer { flex: 1; }
.appbar__btn {
	width: 40px; height: 40px;
	display: inline-grid; place-items: center;
	border-radius: 10px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--fg-muted);
	cursor: pointer;
	transition: background .12s, color .12s;
}
.appbar__btn:hover { background: var(--surface-muted); color: var(--fg); }
.appbar__btn svg { width: 20px; height: 20px; }
.appbar .avatar {
	width: 34px; height: 34px;
	border-radius: 999px;
	background: var(--primary-soft);
	color: var(--primary-ink);
	display: grid; place-items: center;
	font-weight: 700; font-size: 12.5px;
	border: 1px solid #bbf7d0;
}

.wrap {
	width: 100%;
	max-width: 620px;
	margin: 0 auto;
	padding: 16px 16px 40px;
	flex: 1;
}

/* Client hero */
.hero {
	background: linear-gradient(135deg, #16a34a, #15803d);
	color: #fff;
	border-radius: var(--radius);
	padding: 20px 20px 18px;
	box-shadow: var(--shadow-md);
	position: relative;
	overflow: hidden;
}
.hero::after {
	content: '';
	position: absolute;
	right: -40px; top: -40px;
	width: 160px; height: 160px;
	background: rgba(255,255,255,0.10);
	border-radius: 999px;
}
.hero__eyebrow { font-size: 12px; opacity: .85; font-weight: 500; letter-spacing: .01em; }
.hero__name { font-size: 21px; font-weight: 720; letter-spacing: -0.02em; margin: 3px 0 10px; line-height: 1.15; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.hero__chip {
	display: inline-flex; align-items: center; gap: 6px;
	background: rgba(255,255,255,0.16);
	border: 1px solid rgba(255,255,255,0.22);
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 12.5px;
	font-weight: 550;
}
.hero__chip svg { width: 13px; height: 13px; }

/* Stat strip */
.stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 14px;
}
.stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 12px 12px;
	box-shadow: var(--shadow-sm);
	text-align: center;
}
.stat__val { font-size: 22px; font-weight: 720; letter-spacing: -0.02em; }
.stat__val--ok { color: var(--primary-ink); }
.stat__val--warn { color: #b45309; }
.stat__label { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; }

/* Section title */
.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 24px 2px 12px;
}
.section-head h2 { font-size: 15.5px; font-weight: 680; letter-spacing: -0.01em; margin: 0; }
.section-head p { font-size: 12.5px; color: var(--fg-muted); margin: 2px 0 0; }

/* Area segmented control (scrolls horizontally on mobile) */
.areas {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px;
	margin: 0 -2px 4px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.areas::-webkit-scrollbar { display: none; }
.area-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 14px;
	border-radius: 999px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--fg-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}
.area-pill svg { width: 15px; height: 15px; }
.area-pill.active {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
	box-shadow: var(--shadow-sm);
}

/* Service accordion list */
.svc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.svc {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}
.svc__head {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 15px 16px;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	color: var(--fg);
}
.svc__icon {
	width: 38px; height: 38px;
	flex-shrink: 0;
	border-radius: 10px;
	background: var(--primary-soft);
	color: var(--primary-ink);
	display: grid; place-items: center;
}
.svc__icon svg { width: 18px; height: 18px; }
.svc__title { flex: 1; min-width: 0; }
.svc__name { font-size: 13.5px; font-weight: 620; line-height: 1.3; }
.svc__sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.svc__chev {
	width: 20px; height: 20px;
	color: var(--fg-subtle);
	flex-shrink: 0;
	transition: transform .2s ease;
}
.svc.open .svc__chev { transform: rotate(90deg); color: var(--primary); }
.svc.open .svc__icon { background: var(--primary); color: #fff; }

.svc__body { display: none; border-top: 1px solid var(--border); background: #fbfbfa; }
.svc.open .svc__body { display: block; }

/* History rows (mobile-friendly, no table) */
.record {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	border-bottom: 1px solid var(--border);
}
.record:last-child { border-bottom: none; }
.record__main { flex: 1; min-width: 0; }
.record__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record__ot { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.record__date { font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.record__desc { font-size: 12px; color: var(--fg-muted); margin-top: 3px; }

.badge {
	display: inline-flex; align-items: center; gap: 5px;
	height: 21px; padding: 0 9px;
	border-radius: 999px;
	font-size: 11.5px; font-weight: 600;
	border: 1px solid transparent;
	white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge--success { background: var(--primary-soft); color: #15803d; border-color: #bbf7d0; }
.badge--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge--danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.dl {
	flex-shrink: 0;
	display: inline-flex; align-items: center; gap: 6px;
	height: 34px; padding: 0 12px;
	border-radius: var(--radius-sm);
	font-size: 12.5px; font-weight: 600;
	color: var(--primary-ink);
	background: var(--primary-soft);
	border: 1px solid #bbf7d0;
	cursor: pointer;
}
.dl:hover { background: #dcfce7; }
.dl svg { width: 14px; height: 14px; }
.dl--off { color: var(--fg-subtle); background: var(--surface-muted); border-color: var(--border); cursor: default; }

/* Section footer note */
.helpnote {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 20px;
	padding: 14px 16px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: var(--radius);
	color: #1e40af;
	font-size: 12.5px;
	line-height: 1.5;
}
.helpnote svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ========================= Bottom sheet (adjuntos) ========================= */
.sheet-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(24,24,27,.45);
	z-index: 60;
	display: none;
	align-items: flex-end;
	justify-content: center;
}
.sheet-backdrop.open { display: flex; }
.sheet {
	width: 100%;
	max-width: 620px;
	background: var(--surface);
	border-radius: 20px 20px 0 0;
	box-shadow: var(--shadow-lg);
	padding: 8px 18px 24px;
	max-height: 82vh;
	overflow-y: auto;
	animation: sheet-up .24s ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__grip { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 6px auto 14px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet__title { font-size: 16px; font-weight: 680; }
.file {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-bottom: 10px;
}
.file__icon {
	width: 36px; height: 36px; flex-shrink: 0;
	border-radius: 9px;
	background: #fef2f2; color: #dc2626;
	display: grid; place-items: center;
}
.file__icon svg { width: 18px; height: 18px; }
.file__meta { flex: 1; min-width: 0; }
.file__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__size { font-size: 11.5px; color: var(--fg-subtle); margin-top: 1px; }

/* Desktop niceties: portal stays a comfortable centered column */
@media (min-width: 560px) {
	.wrap { padding-top: 22px; }
}
