/* ==========================================================================
   Portal Altivia - Torre JP XI
   Mobile-first: se disena a 375px y se expande.
   ========================================================================== */

:root {
	color-scheme: light;   /* portal siempre en claro */

	--pt-brand: #12314f;
	--pt-brand-soft: #1e4a75;
	--pt-brand-ink: #ffffff;

	--pt-bg: #f4f6f8;
	--pt-surface: #ffffff;
	--pt-surface-2: #f8fafc;
	--pt-border: #dfe4ea;
	--pt-border-strong: #c4ccd6;

	--pt-text: #16202b;
	--pt-text-soft: #5b6774;
	--pt-text-faint: #8a94a0;

	--pt-ok: #0f7a4d;
	--pt-ok-bg: #e5f5ed;
	--pt-danger: #b3261e;
	--pt-danger-bg: #fdeceb;
	--pt-warn: #9a6100;
	--pt-warn-bg: #fdf3e2;
	--pt-info: #14557a;
	--pt-info-bg: #e7f2f8;

	--pt-radius: 12px;
	--pt-radius-sm: 8px;
	--pt-shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 12px rgba(16, 32, 48, .05);
	--pt-shadow-lg: 0 -4px 24px rgba(16, 32, 48, .14);

	--pt-tabbar-h: 60px;
	--pt-sidebar-w: 264px;
	--pt-tap: 44px;

	--pt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--pt-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--pt-text);
	background: var(--pt-bg);
	-webkit-font-smoothing: antialiased;
}

body.pt-no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }

a { color: var(--pt-info); text-decoration: none; }
a:hover { text-decoration: underline; }

.pt-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* --------------------------------------------------------------- Shell -- */

.pt-shell { min-height: 100vh; }

.pt-sidebar { display: none; }

.pt-main-col {
	min-height: 100vh;
	padding-bottom: calc(var(--pt-tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

.pt-topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	padding-top: calc(14px + env(safe-area-inset-top, 0px));
	background: var(--pt-brand);
	color: var(--pt-brand-ink);
}

.pt-topbar h1 { font-size: 1.25rem; }
.pt-topbar-title { flex: 1; min-width: 0; }
.pt-topbar-sub { margin: 2px 0 0; font-size: .8125rem; opacity: .78; }
.pt-topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

.pt-main { padding: 16px; max-width: 900px; }

/* ------------------------------------------------------------ Tab bar -- */

.pt-tabbar {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 40;
	display: flex;
	background: var(--pt-surface);
	border-top: 1px solid var(--pt-border);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pt-tab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: var(--pt-tabbar-h);
	padding: 6px 2px;
	border: 0;
	background: none;
	font: inherit;
	font-size: .6875rem;
	color: var(--pt-text-faint);
	cursor: pointer;
	text-decoration: none;
}
.pt-tab:hover { text-decoration: none; }
.pt-tab .pt-icon { width: 23px; height: 23px; }
.pt-tab.is-active { color: var(--pt-brand-soft); font-weight: 600; }

/* -------------------------------------------------------- Hoja "Mas" -- */

.pt-sheet-backdrop {
	position: fixed; inset: 0; z-index: 45;
	background: rgba(10, 18, 26, .45);
	opacity: 0; pointer-events: none;
	transition: opacity .2s ease;
}
.pt-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.pt-sheet {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 50;
	background: var(--pt-surface);
	border-radius: 16px 16px 0 0;
	box-shadow: var(--pt-shadow-lg);
	transform: translateY(100%);
	transition: transform .25s cubic-bezier(.32, .72, 0, 1);
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.pt-sheet.is-open { transform: translateY(0); }

.pt-sheet-handle {
	width: 38px; height: 4px;
	margin: 10px auto 4px;
	border-radius: 2px;
	background: var(--pt-border-strong);
}

.pt-sheet-nav { padding: 4px 8px 8px; }

.pt-sheet-item,
.pt-nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--pt-tap);
	padding: 11px 14px;
	border-radius: var(--pt-radius-sm);
	color: var(--pt-text);
	font-size: 1rem;
}
.pt-sheet-item:hover, .pt-nav-item:hover {
	background: var(--pt-surface-2);
	text-decoration: none;
}
.pt-sheet-item--danger { color: var(--pt-danger); }

/* ------------------------------------------------------------ Iconos -- */

.pt-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ------------------------------------------------------------- Cards -- */

.pt-card {
	background: var(--pt-surface);
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	box-shadow: var(--pt-shadow);
	padding: 16px;
	margin-bottom: 12px;
}

.pt-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.pt-card-title { font-size: .8125rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--pt-text-soft); }

.pt-section-title {
	margin: 22px 0 10px;
	font-size: .8125rem;
	font-weight: 650;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--pt-text-soft);
}
.pt-section-title:first-child { margin-top: 0; }

/* --------------------------------------------------- Tarjeta de saldo -- */

.pt-balance {
	border-radius: var(--pt-radius);
	padding: 22px 18px;
	margin-bottom: 14px;
	border: 1px solid transparent;
}
.pt-balance--ok { background: var(--pt-ok-bg); border-color: color-mix(in srgb, var(--pt-ok) 25%, transparent); }
.pt-balance--due { background: var(--pt-danger-bg); border-color: color-mix(in srgb, var(--pt-danger) 25%, transparent); }

.pt-balance-label { font-size: .875rem; color: var(--pt-text-soft); margin: 0 0 4px; }
.pt-balance-amount { font-size: 2.125rem; font-weight: 700; line-height: 1.1; }
.pt-balance--ok .pt-balance-amount { color: var(--pt-ok); }
.pt-balance--due .pt-balance-amount { color: var(--pt-danger); }
.pt-balance-note { margin: 8px 0 0; font-size: .875rem; color: var(--pt-text-soft); }

/* ---------------------------------------------------------- Metricas -- */

.pt-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pt-metric {
	min-width: 0;
	container-type: inline-size;
	background: var(--pt-surface);
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	padding: 13px 14px;
}
.pt-metric-label { font-size: .75rem; color: var(--pt-text-soft); margin: 0 0 3px; }
.pt-metric-value {
	font-weight: 650;
	white-space: nowrap;
	font-size: clamp(0.9rem, 5vw, 1.25rem);
}

@supports (container-type: inline-size) {
	.pt-metric-value { font-size: clamp(0.8rem, 11cqi, 1.25rem); }
}
.pt-metric-sub { font-size: .75rem; color: var(--pt-text-faint); margin: 2px 0 0; }

/* ------------------------------------------------------------ Badges -- */

.pt-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 600;
	white-space: nowrap;
}
.pt-badge--ok { background: var(--pt-ok-bg); color: var(--pt-ok); }
.pt-badge--danger { background: var(--pt-danger-bg); color: var(--pt-danger); }
.pt-badge--warn { background: var(--pt-warn-bg); color: var(--pt-warn); }
.pt-badge--info { background: var(--pt-info-bg); color: var(--pt-info); }
.pt-badge--muted { background: var(--pt-surface-2); color: var(--pt-text-soft); }

/* ----------------------------------------------------------- Botones -- */

.pt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: var(--pt-tap);
	padding: 10px 17px;
	border: 1px solid var(--pt-border-strong);
	border-radius: var(--pt-radius-sm);
	background: var(--pt-surface);
	color: var(--pt-text);
	font: inherit;
	font-size: .9375rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}
.pt-btn:hover { background: var(--pt-surface-2); text-decoration: none; }
.pt-btn:disabled { opacity: .55; cursor: not-allowed; }

.pt-btn--primary {
	background: var(--pt-brand);
	border-color: var(--pt-brand);
	color: var(--pt-brand-ink);
}
.pt-btn--primary:hover { background: var(--pt-brand-soft); }
.pt-btn--danger { color: var(--pt-danger); border-color: color-mix(in srgb, var(--pt-danger) 40%, transparent); }
.pt-btn--block { width: 100%; }
.pt-btn--sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }

/* --------------------------------------------------------- Formulario -- */

.pt-field { margin-bottom: 14px; }
.pt-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 5px; color: var(--pt-text-soft); }

.pt-input, .pt-select, .pt-textarea {
	width: 100%;
	min-height: var(--pt-tap);
	padding: 10px 12px;
	border: 1px solid var(--pt-border-strong);
	border-radius: var(--pt-radius-sm);
	background: var(--pt-surface);
	color: var(--pt-text);
	font: inherit;
	font-size: 1rem; /* 16px: evita el zoom automatico de iOS */
}
.pt-textarea { min-height: 96px; resize: vertical; }
.pt-input:focus, .pt-select:focus, .pt-textarea:focus {
	outline: 2px solid var(--pt-brand-soft);
	outline-offset: 1px;
	border-color: var(--pt-brand-soft);
}
.pt-help { font-size: .8125rem; color: var(--pt-text-faint); margin: 5px 0 0; }

.pt-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pt-filters .pt-select, .pt-filters .pt-input { width: auto; flex: 1 1 140px; min-width: 0; }

/* ------------------------------------------------------------ Estados -- */

.pt-state { text-align: center; padding: 40px 20px; color: var(--pt-text-soft); }
.pt-state-title { font-weight: 650; color: var(--pt-text); margin: 0 0 6px; }
.pt-state-msg { margin: 0 0 16px; font-size: .9375rem; }

.pt-spinner {
	width: 26px; height: 26px;
	margin: 0 auto 12px;
	border: 3px solid var(--pt-border);
	border-top-color: var(--pt-brand-soft);
	border-radius: 50%;
	animation: pt-spin .8s linear infinite;
}
@keyframes pt-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.pt-spinner { animation-duration: 2s; }
	.pt-sheet, .pt-sheet-backdrop, .pt-toast { transition: none; }
}

/* ------------------------------------------------------------- Toast -- */

.pt-toast {
	position: fixed;
	left: 50%;
	bottom: calc(var(--pt-tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
	z-index: 60;
	transform: translate(-50%, 16px);
	max-width: min(90vw, 420px);
	padding: 12px 16px;
	border-radius: var(--pt-radius-sm);
	background: #16202b;
	color: #fff;
	font-size: .9375rem;
	box-shadow: var(--pt-shadow);
	opacity: 0;
	transition: opacity .2s ease, transform .2s ease;
}
.pt-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.pt-toast--error { background: var(--pt-danger); }
.pt-toast--success { background: var(--pt-ok); }

/* -------------------------------------------------- Listas / filas ---- */

.pt-row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: var(--pt-tap);
	padding: 13px 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	margin-bottom: 8px;
	text-align: left;
	font: inherit;
	color: var(--pt-text);
	cursor: pointer;
}
.pt-row:hover { background: var(--pt-surface-2); text-decoration: none; }
.pt-row-main { flex: 1; min-width: 0; }
.pt-row-title { font-weight: 600; }
.pt-row-sub { font-size: .8125rem; color: var(--pt-text-soft); }
.pt-row-end { text-align: right; flex-shrink: 0; }

.pt-kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: .9375rem; }
.pt-kv + .pt-kv { border-top: 1px solid var(--pt-border); }
.pt-kv dt { color: var(--pt-text-soft); margin: 0; }
.pt-kv dd { margin: 0; font-weight: 600; text-align: right; }

/* --------------------------------------------------------- Escritorio -- */

@media (min-width: 768px) {
	.pt-tabbar, .pt-sheet, .pt-sheet-backdrop { display: none; }

	.pt-shell { display: flex; }

	.pt-sidebar {
		display: flex;
		flex-direction: column;
		width: var(--pt-sidebar-w);
		flex-shrink: 0;
		min-height: 100vh;
		position: sticky;
		top: 0;
		height: 100vh;
		background: var(--pt-surface);
		border-right: 1px solid var(--pt-border);
		padding: 18px 12px;
	}

	.pt-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
	.pt-brand-mark {
		display: grid; place-items: center;
		width: 38px; height: 38px;
		border-radius: 10px;
		background: var(--pt-brand);
		color: var(--pt-brand-ink);
		font-weight: 700; font-size: .9375rem;
	}
	.pt-brand-text strong { display: block; font-size: .9375rem; }
	.pt-brand-text small { display: block; font-size: .75rem; color: var(--pt-text-faint); }

	.pt-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
	.pt-nav-item.is-active { background: var(--pt-info-bg); color: var(--pt-info); font-weight: 650; }

	.pt-sidebar-foot { border-top: 1px solid var(--pt-border); padding: 12px 14px 0; }
	.pt-whoami strong { display: block; font-size: .9375rem; }
	.pt-whoami small { display: block; font-size: .8125rem; color: var(--pt-text-faint); }
	.pt-logout { display: inline-block; margin-top: 8px; font-size: .875rem; color: var(--pt-danger); }

	.pt-main-col { flex: 1; min-width: 0; padding-bottom: 40px; }
	.pt-main { padding: 24px 28px; }
	.pt-topbar { padding: 18px 28px; }
	.pt-topbar h1 { font-size: 1.5rem; }

	.pt-metrics { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1100px) {
	.pt-main { max-width: 1000px; }
}

/* ---------------------------------------------------------- Timeline ---- */

.pt-timeline { list-style: none; margin: 0; padding: 0; }

.pt-tl-item { position: relative; padding-left: 22px; }
.pt-tl-item::before {
	content: "";
	position: absolute;
	left: 5px; top: 0; bottom: 0;
	width: 2px;
	background: var(--pt-border);
}
.pt-tl-item:first-child::before { top: 22px; }
.pt-tl-item:last-child::before { bottom: auto; height: 22px; }

.pt-tl-dot {
	position: absolute;
	left: -22px; top: 18px;
	width: 12px; height: 12px;
	border-radius: 50%;
	border: 2px solid var(--pt-surface);
	background: var(--pt-text-faint);
}
.pt-tl-item--charge .pt-tl-dot { background: var(--pt-danger); }
.pt-tl-item--payment .pt-tl-dot { background: var(--pt-ok); }

.pt-tl-card {
	display: block;
	position: relative;
	width: 100%;
	min-height: var(--pt-tap);
	margin-bottom: 8px;
	padding: 13px 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	font: inherit;
	color: var(--pt-text);
	text-align: left;
	cursor: pointer;
}
.pt-tl-card:hover { background: var(--pt-surface-2); }

.pt-tl-body { display: block; }
.pt-tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pt-tl-label { font-weight: 600; }
.pt-tl-amount { font-weight: 700; white-space: nowrap; }
.pt-tl-amount.is-charge { color: var(--pt-danger); }
.pt-tl-amount.is-payment { color: var(--pt-ok); }

.pt-tl-meta {
	display: flex;
	gap: 8px;
	margin-top: 2px;
	font-size: .8125rem;
	color: var(--pt-text-soft);
}
.pt-tl-meta > span + span::before { content: "\00b7"; margin-right: 8px; }
.pt-tl-meta { flex-wrap: wrap; }
.pt-tl-balance { margin-left: auto; white-space: nowrap; }
.pt-tl-balance::before { content: none !important; }
.pt-tl-balance b { font-weight: 600; }
.pt-tl-balance b.is-due { color: var(--pt-danger); }
.pt-tl-balance b.is-ok { color: var(--pt-ok); }
.pt-tl-status { display: block; margin-top: 6px; }

.pt-tl-detail {
	margin: -4px 0 12px;
	padding: 12px 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface-2);
}
.pt-tl-detail dl { margin: 0; }
.pt-tl-alloc { margin-top: 12px; }
.pt-tl-alloc .pt-section-title { margin: 0 0 6px; }
.pt-kv-long { font-weight: 400; font-size: .875rem; max-width: 60%; }
.pt-attach { display: flex; margin-bottom: 6px; word-break: break-all; }

/* ------------------------------------------------------------- Lineas ---- */

.pt-line { display: flex; gap: 12px; justify-content: space-between; padding: 9px 0; }
.pt-line + .pt-line { border-top: 1px solid var(--pt-border); }
.pt-line-main { min-width: 0; }
.pt-line-title { font-weight: 600; font-size: .9375rem; }
.pt-line-sub { font-size: .8125rem; color: var(--pt-text-soft); }
.pt-line-amount { font-weight: 600; white-space: nowrap; }

/* ----------------------------------------------------------- Paginador --- */

.pt-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pt-pager-info { font-size: .8125rem; color: var(--pt-text-soft); }

/* -------------------------------------------------------------- Modal ---- */

.pt-modal-backdrop {
	position: fixed; inset: 0; z-index: 55;
	background: rgba(10, 18, 26, .5);
}

.pt-modal {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 56;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: var(--pt-surface);
	border-radius: 16px 16px 0 0;
	box-shadow: var(--pt-shadow-lg);
}

.pt-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 12px;
	border-bottom: 1px solid var(--pt-border);
}
.pt-modal-head h2 { font-size: 1.0625rem; }

.pt-modal-close {
	width: var(--pt-tap); height: var(--pt-tap);
	border: 0; border-radius: 50%;
	background: none;
	font-size: 1.75rem; line-height: 1;
	color: var(--pt-text-soft);
	cursor: pointer;
}
.pt-modal-close:hover { background: var(--pt-surface-2); }

.pt-modal-body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
	.pt-modal {
		left: 50%; bottom: auto; right: auto;
		top: 50%;
		transform: translate(-50%, -50%);
		width: min(560px, 92vw);
		border-radius: var(--pt-radius);
		max-height: 84vh;
	}
	.pt-modal-body { padding-bottom: 20px; }
}

/* ------------------------------------------------------- Grafico SVG ---- */

.pt-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pt-chart { display: block; width: 100%; height: auto; }

.pt-chart-grid { stroke: var(--pt-border); stroke-width: 1; stroke-dasharray: 3 3; }
.pt-chart-tick { fill: var(--pt-text-faint); font-size: 9px; }
.pt-chart-bar { fill: var(--pt-brand-soft); opacity: .55; }
.pt-chart-bar.is-last { opacity: 1; }
.pt-chart-value { fill: var(--pt-text-soft); font-size: 9px; }
.pt-chart-label { fill: var(--pt-text-faint); font-size: 9px; }

/* ------------------------------------------------- Formula y notas ------ */

.pt-formula {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: var(--pt-radius-sm);
	background: var(--pt-surface-2);
	border: 1px solid var(--pt-border);
	font-size: .8125rem;
	color: var(--pt-text-soft);
	line-height: 1.7;
}

.pt-note {
	margin-top: 20px;
	padding: 16px;
	border-radius: var(--pt-radius);
	background: var(--pt-info-bg);
	border: 1px solid color-mix(in srgb, var(--pt-info) 22%, transparent);
	font-size: .9375rem;
}
.pt-note h3 { font-size: .9375rem; margin-bottom: 8px; color: var(--pt-info); }
.pt-note p { margin: 0 0 8px; }
.pt-note p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------- Calendario --- */

.pt-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

.pt-cal-dow, .pt-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pt-cal-dow {
	margin-bottom: 4px;
	font-size: .75rem;
	font-weight: 600;
	color: var(--pt-text-faint);
	text-align: center;
}

.pt-cal-day {
	position: relative;
	aspect-ratio: 1;
	min-height: 40px;
	display: grid;
	place-items: center;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius-sm);
	background: var(--pt-surface);
	font: inherit;
	font-size: .9375rem;
	color: var(--pt-text);
	cursor: pointer;
}
.pt-cal-day:hover:not(:disabled) { background: var(--pt-surface-2); }
.pt-cal-day.is-blank { border-color: transparent; background: none; cursor: default; }
.pt-cal-day.is-disabled { color: var(--pt-text-faint); background: var(--pt-surface-2); cursor: not-allowed; opacity: .6; }
.pt-cal-day.is-selected { background: var(--pt-brand); border-color: var(--pt-brand); color: var(--pt-brand-ink); font-weight: 700; }

.pt-cal-day.is-busy::after,
.pt-cal-day.is-mine::after {
	content: "";
	position: absolute;
	bottom: 5px;
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--pt-warn);
}
.pt-cal-day.is-mine::after { background: var(--pt-info); }
.pt-cal-day.is-selected::after { background: var(--pt-brand-ink); }

.pt-cal-legend {
	display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
	margin: 10px 0 0;
	font-size: .75rem;
	color: var(--pt-text-soft);
}
.pt-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pt-dot--busy { background: var(--pt-warn); }
.pt-dot--mine { background: var(--pt-info); margin-left: 10px; }

/* ---------------------------------------------------------- Detalles ---- */

.pt-details { margin-top: 10px; font-size: .9375rem; }
.pt-details summary {
	min-height: var(--pt-tap);
	display: flex; align-items: center;
	cursor: pointer;
	font-weight: 600;
	color: var(--pt-info);
}

.pt-warn-box {
	margin-top: 10px;
	padding: 12px 14px;
	border-radius: var(--pt-radius-sm);
	background: var(--pt-warn-bg);
	border: 1px solid color-mix(in srgb, var(--pt-warn) 30%, transparent);
	color: var(--pt-warn);
	font-size: .9375rem;
}

/* ---------------------------------------------------------- Hilo/chat --- */

.pt-thread { display: flex; flex-direction: column; gap: 8px; }

.pt-bubble {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px 14px 14px 3px;
	background: var(--pt-surface-2);
	border: 1px solid var(--pt-border);
	font-size: .9375rem;
}
.pt-bubble.is-mine {
	align-self: flex-end;
	border-radius: 14px 14px 3px 14px;
	background: var(--pt-info-bg);
	border-color: color-mix(in srgb, var(--pt-info) 25%, transparent);
}
.pt-bubble.is-internal {
	background: var(--pt-warn-bg);
	border-color: color-mix(in srgb, var(--pt-warn) 35%, transparent);
	border-style: dashed;
}
.pt-bubble p { margin: 4px 0 0; white-space: pre-wrap; }
.pt-bubble-head {
	display: flex; justify-content: space-between; gap: 10px;
	font-size: .75rem;
	color: var(--pt-text-soft);
}

.pt-board-tools {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 2px dashed var(--pt-border-strong);
}

/* ------------------------------------------------------------- Fotos ---- */

.pt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pt-photos img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--pt-radius-sm);
	border: 1px solid var(--pt-border);
	display: block;
}

/* ------------------------------------------------------------ Grupos ---- */

.pt-group {
	margin-bottom: 10px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	overflow: hidden;
}
.pt-group > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: var(--pt-tap);
	padding: 12px 14px;
	cursor: pointer;
	font-weight: 650;
}
.pt-group > summary::-webkit-details-marker { display: none; }
.pt-group[open] > summary { border-bottom: 1px solid var(--pt-border); }
.pt-group .pt-row { border: 0; border-radius: 0; margin: 0; }
.pt-group .pt-row + .pt-row { border-top: 1px solid var(--pt-border); }

/* ------------------------------------------------------------- Tabs ----- */

.pt-tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--pt-border);
	scrollbar-width: none;
}
.pt-tabs::-webkit-scrollbar { display: none; }

.pt-tabs-item {
	flex: 0 0 auto;
	min-height: var(--pt-tap);
	padding: 10px 14px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	font: inherit;
	font-size: .9375rem;
	font-weight: 600;
	color: var(--pt-text-soft);
	cursor: pointer;
	white-space: nowrap;
}
.pt-tabs-item.is-active { color: var(--pt-brand-soft); border-bottom-color: var(--pt-brand-soft); }

/* ------------------------------------------------- Libro de cuentas ----- */

.pt-ledger {
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	overflow: hidden;
}

.pt-ledger-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 14px 9px 12px;
	font-size: .9375rem;
}
.pt-ledger-row + .pt-ledger-row { border-top: 1px solid var(--pt-border); }
.pt-ledger-row.is-group { font-weight: 650; background: var(--pt-surface-2); }
.pt-ledger-row.is-total { font-weight: 700; }
.pt-ledger-name { min-width: 0; }
.pt-ledger-amount { white-space: nowrap; flex-shrink: 0; }

/* ------------------------------------------------------------ Tabla ----- */

.pt-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
.pt-table { border-collapse: collapse; width: 100%; font-size: .8125rem; white-space: nowrap; }
.pt-table th, .pt-table td { padding: 7px 10px; border-bottom: 1px solid var(--pt-border); text-align: left; }
.pt-table th { font-weight: 650; color: var(--pt-text-soft); background: var(--pt-surface-2); position: sticky; top: 0; }
.pt-table .pt-num { text-align: right; font-variant-numeric: tabular-nums; }
.pt-table tr.is-group { font-weight: 650; background: var(--pt-surface-2); }

/* ==========================================================================
   Segunda pasada de diseno
   ========================================================================== */

/* Colores de la marca, tomados del logo de la torre. */
:root {
	--pt-gold: #f2ce54;
	--pt-olive: #b3b25b;
	--pt-slate: #47596b;
}

/* ------------------------------------------------------------- Marca ----- */

.pt-brand { text-decoration: none; }
.pt-brand:hover { text-decoration: none; }

.pt-brand-logo {
	display: block;
	width: 100%;
	max-width: 190px;
	height: auto;
}

/* ------------------------------------------------------------- Login ----- */

.pt-login {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
	background:
		radial-gradient(1100px 500px at 50% -12%, color-mix(in srgb, var(--pt-brand) 16%, transparent), transparent),
		var(--pt-bg);
}

.pt-login-card {
	width: 100%;
	max-width: 400px;
	padding: 28px 24px 24px;
	background: var(--pt-surface);
	border: 1px solid var(--pt-border);
	border-radius: 16px;
	box-shadow: var(--pt-shadow);
}

.pt-login-brand { text-align: center; margin-bottom: 22px; }
.pt-login-brand img { width: 100%; max-width: 210px; height: auto; margin: 0 auto 6px; display: block; }
.pt-login-brand p { margin: 0; font-size: .875rem; color: var(--pt-text-soft); }

.pt-brand-mark--lg {
	width: 56px; height: 56px;
	margin: 0 auto 10px;
	font-size: 1.25rem;
	border-radius: 14px;
}

.pt-input-group { display: flex; gap: 8px; }
.pt-input-group .pt-input { flex: 1; min-width: 0; }
.pt-input-addon {
	flex-shrink: 0;
	min-width: 64px;
	min-height: var(--pt-tap);
	padding: 0 12px;
	border: 1px solid var(--pt-border-strong);
	border-radius: var(--pt-radius-sm);
	background: var(--pt-surface-2);
	font: inherit;
	font-size: .875rem;
	color: var(--pt-text-soft);
	cursor: pointer;
}

.pt-login-error {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: var(--pt-radius-sm);
	background: var(--pt-danger-bg);
	border: 1px solid color-mix(in srgb, var(--pt-danger) 30%, transparent);
	color: var(--pt-danger);
	font-size: .875rem;
}

.pt-login-help {
	margin: 16px 0 0;
	font-size: .8125rem;
	color: var(--pt-text-faint);
	text-align: center;
	line-height: 1.5;
}

.pt-login-foot { margin: 0; font-size: .8125rem; color: var(--pt-text-faint); }

/* -------------------------------------------- Facturado / Pagado / Saldo -- */

.pt-totals {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}
/* El saldo, que es lo que de verdad importa, ocupa el ancho completo. */
.pt-totals > .pt-total:last-child { grid-column: 1 / -1; }

.pt-total {
	min-width: 0;   /* sin esto el monto largo ensancha la columna y desborda */
	container-type: inline-size;
	padding: 14px 16px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
}
.pt-total-label {
	margin: 0 0 4px;
	font-size: .75rem;
	font-weight: 650;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--pt-text-soft);
}
/* El monto se encoge con el bloque en vez de partirse en dos lineas.
   cqi es el 1% del ancho del contenedor; el clamp en vw queda de respaldo
   para navegadores sin container queries. */
.pt-total-value {
	margin: 0;
	font-weight: 700;
	line-height: 1.15;
	white-space: nowrap;
	font-size: clamp(0.95rem, 5.6vw, 1.375rem);
}

@supports (container-type: inline-size) {
	.pt-total-value { font-size: clamp(0.85rem, 11.5cqi, 1.375rem); }
}
.pt-total-note { margin: 6px 0 0; font-size: .8125rem; color: var(--pt-text-soft); }

.pt-total--paid .pt-total-value { color: var(--pt-ok); }
.pt-total--ok { background: var(--pt-ok-bg); border-color: color-mix(in srgb, var(--pt-ok) 25%, transparent); }
.pt-total--ok .pt-total-value { color: var(--pt-ok); }
.pt-total--due { background: var(--pt-danger-bg); border-color: color-mix(in srgb, var(--pt-danger) 25%, transparent); }
.pt-total--due .pt-total-value { color: var(--pt-danger); }

@media (min-width: 768px) {
	.pt-totals { grid-template-columns: repeat(3, 1fr); }
	.pt-totals > .pt-total:last-child { grid-column: auto; }
}

/* --------------------------------------------------- Tabla de datos ------ */

.pt-datatable {
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	overflow: hidden;   /* recorta las esquinas de la tabla */
}
.pt-datatable table { width: 100%; border-collapse: collapse; font-size: .9375rem; }

.pt-datatable th {
	padding: 10px 14px;
	background: var(--pt-surface-2);
	border-bottom: 1px solid var(--pt-border);
	font-size: .75rem;
	font-weight: 650;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--pt-text-soft);
	text-align: left;
	white-space: nowrap;
}
.pt-datatable td { padding: 10px 14px; border-bottom: 1px solid var(--pt-border); vertical-align: middle; }
.pt-datatable tbody tr:last-child td { border-bottom: 0; }
.pt-datatable tbody tr { cursor: pointer; }
.pt-datatable tbody tr:hover { background: var(--pt-surface-2); }
.pt-datatable tbody tr:focus-visible { outline: 2px solid var(--pt-brand-soft); outline-offset: -2px; }

.pt-datatable .pt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-datatable .pt-col-end { text-align: right; white-space: nowrap; }

.pt-cell-title { display: block; font-weight: 600; }
.pt-cell-sub { display: block; font-size: .8125rem; color: var(--pt-text-soft); }

/* En movil se ocultan las columnas secundarias; el detalle esta al tocar. */
@media (max-width: 599px) {
	.pt-col-hide-sm { display: none; }
	.pt-datatable th, .pt-datatable td { padding: 9px 11px; }
}

/* ---------------------------------------------------------- Toggle ------- */

.pt-toggle {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--pt-border-strong);
	border-radius: 999px;
	background: var(--pt-surface-2);
}
.pt-toggle button {
	min-width: 52px;
	min-height: 32px;
	padding: 4px 14px;
	border: 0;
	border-radius: 999px;
	background: none;
	font: inherit;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--pt-text-soft);
	cursor: pointer;
}
.pt-toggle button.is-active {
	background: var(--pt-brand);
	color: var(--pt-brand-ink);
}

/* ------------------------------------------------- Grafico coloreado ----- */

.pt-chart-bar { fill: var(--pt-slate); opacity: .45; transition: opacity .15s ease; }
.pt-chart-bar.is-last { fill: var(--pt-gold); opacity: 1; }

/* ---------------------------------------------- Calendario en ancho ------ */

.pt-cal { max-width: 420px; }

@media (min-width: 768px) {
	/* Sin tope, cada celda se vuelve un cuadrado enorme por el aspect-ratio. */
	.pt-cal-dow, .pt-cal-grid { max-width: 420px; }
	.pt-cal-head { max-width: 420px; }
	.pt-cal-day { min-height: 46px; }
}

/* ------------------------------------------------------- Area comun ------ */

.pt-area-card { padding-top: 0; overflow: hidden; }
.pt-area-photo {
	margin: 0 -16px 14px;
	background: var(--pt-surface-2);
}
.pt-area-photo img {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: cover;
}

@media (min-width: 768px) {
	.pt-area-photo img { max-height: 280px; }
}

/* -------------------------------------------------------- Carpetas ------- */

.pt-folders {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.pt-folder {
	min-width: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 16px 14px 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	box-shadow: var(--pt-shadow);
	font: inherit;
	text-align: left;
	color: var(--pt-text);
	cursor: pointer;
}
.pt-folder:hover { background: var(--pt-surface-2); }

.pt-folder-icon { display: block; color: var(--pt-brand-soft); margin-bottom: 8px; }
.pt-folder-icon svg { width: 30px; height: 30px; }

.pt-folder-name { font-weight: 650; font-size: .9375rem; line-height: 1.25; }
.pt-folder-meta { font-size: .8125rem; color: var(--pt-text-soft); }

.pt-folder-badge {
	position: absolute;
	top: 10px; right: 10px;
	min-width: 22px; height: 22px;
	display: grid; place-items: center;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--pt-danger);
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
}

.pt-unseen-dot {
	display: inline-block;
	width: 8px; height: 8px;
	margin-right: 7px;
	border-radius: 50%;
	background: var(--pt-danger);
	vertical-align: middle;
}
.pt-datatable tr.is-unseen .pt-cell-title { font-weight: 700; }

/* ------------------------------------------------- Modal mas ancha ------- */

@media (min-width: 768px) {
	.pt-modal { width: min(760px, 94vw); max-height: 88vh; }
}
@media (min-width: 1200px) {
	.pt-modal { width: min(880px, 92vw); }
}

/* Las fotos de una incidencia se adaptan a la ventana, no al reves. */
.pt-photos { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.pt-photos img { max-height: 160px; aspect-ratio: 4 / 3; }

@media (min-width: 768px) {
	.pt-photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.pt-photos img { max-height: 190px; }
}

/* Cualquier imagen dentro de una modal queda contenida por la ventana. */
.pt-modal-body img { max-width: 100%; height: auto; }

/* ------------------------------------------------- Filtros en movil ------ */

@media (max-width: 599px) {
	/* El primer filtro ocupa toda la fila y los dos siguientes van juntos. */
	.pt-filters--stack-first { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.pt-filters--stack-first > * { min-width: 0; width: auto; }
	.pt-filters--stack-first > *:first-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   Numeros que se ajustan a su cuadro
   ========================================================================== */

/* Regla general: ningun monto salta de linea, se encoge.
   cqi es el 1% del ancho del contenedor; el clamp en vw es el respaldo. */
.pt-fit,
.pt-metric-value,
.pt-total-value,
.pt-balance-amount,
.pt-eq-value {
	white-space: nowrap;
	overflow-wrap: normal;
}

.pt-metric, .pt-total, .pt-eq-term, .pt-balance, .pt-folder {
	container-type: inline-size;
}

.pt-balance-amount { font-size: clamp(1.1rem, 8vw, 2.125rem); }
.pt-fit { font-size: clamp(0.85rem, 5vw, 1.25rem); }

@supports (container-type: inline-size) {
	.pt-balance-amount { font-size: clamp(1rem, 15cqi, 2.125rem); }
	.pt-fit { font-size: clamp(0.8rem, 11cqi, 1.25rem); }
}

/* ------------------------------------------- Ingresos - Egresos = Result -- */

.pt-equation {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: stretch;
	gap: 8px;
	margin-bottom: 12px;
}
/* En movil el resultado baja a su propia fila, a lo ancho. */
.pt-equation > .pt-eq-op:nth-of-type(2) { display: none; }
.pt-equation > .pt-eq-term--result { grid-column: 1 / -1; }

.pt-eq-term {
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
}
.pt-eq-label {
	margin: 0 0 3px;
	font-size: .7rem;
	font-weight: 650;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--pt-text-soft);
}
.pt-eq-value { margin: 0; font-weight: 700; line-height: 1.15; }
.pt-eq-value.is-expense { color: var(--pt-warn); }

.pt-eq-op {
	display: grid;
	place-items: center;
	min-width: 18px;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--pt-text-faint);
}

.pt-eq-term--result.is-positive {
	background: var(--pt-ok-bg);
	border-color: color-mix(in srgb, var(--pt-ok) 30%, transparent);
}
.pt-eq-term--result.is-positive .pt-eq-value { color: var(--pt-ok); }
.pt-eq-term--result.is-negative {
	background: var(--pt-danger-bg);
	border-color: color-mix(in srgb, var(--pt-danger) 30%, transparent);
}
.pt-eq-term--result.is-negative .pt-eq-value { color: var(--pt-danger); }

@media (min-width: 768px) {
	.pt-equation { grid-template-columns: 1fr auto 1fr auto 1fr; }
	.pt-equation > .pt-eq-op:nth-of-type(2) { display: grid; }
	.pt-equation > .pt-eq-term--result { grid-column: auto; }
}

/* ------------------------------------------------------- Sub-pestanas ---- */

.pt-subtabs {
	display: inline-flex;
	padding: 3px;
	margin-bottom: 12px;
	border: 1px solid var(--pt-border-strong);
	border-radius: 999px;
	background: var(--pt-surface-2);
}
.pt-subtabs button {
	min-height: 34px;
	padding: 5px 18px;
	border: 0;
	border-radius: 999px;
	background: none;
	font: inherit;
	font-size: .875rem;
	font-weight: 600;
	color: var(--pt-text-soft);
	cursor: pointer;
}
.pt-subtabs button.is-active { background: var(--pt-brand); color: var(--pt-brand-ink); }

.pt-datatable tr.pt-row-total td { background: var(--pt-surface-2); border-top: 1.5px solid var(--pt-border-strong); }

/* --------------------------------------- HTML embebido del sistema ------- */

.pt-embed {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 14px;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	background: var(--pt-surface);
	font-size: .9375rem;
}
.pt-embed table { width: 100%; border-collapse: collapse; }
.pt-embed td, .pt-embed th { padding: 5px 8px; }
.pt-embed img { max-width: 100%; height: auto; }

/* Cabecera con el toggle que manda sobre las cards y el grafico. */
.pt-metric-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

/* ------------------------------------- Comprobante: ver y descargar ------ */

.pt-attach-row { display: flex; gap: 6px; margin-bottom: 6px; }
.pt-attach-row .pt-attach { flex: 1; margin-bottom: 0; }
.pt-attach-download { flex: 0 0 44px; justify-content: center; font-size: 1.125rem; line-height: 1; }
.pt-tl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pt-btn-group { display: contents; }

/* --------------------------------------------------- Comunicaciones ----- */

.pt-pill {
	display: inline-grid;
	place-items: center;
	min-width: 18px; height: 18px;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--pt-danger);
	color: #fff;
	font-size: .6875rem;
	font-weight: 700;
}
.pt-subtabs button.is-active .pt-pill { background: var(--pt-gold); color: #12314f; }

.pt-row.is-unseen .pt-row-title { font-weight: 700; }
.pt-row-end { display: flex; align-items: center; gap: 6px; }

.pt-comm-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-comm-body { font-size: 1rem; line-height: 1.65; }
.pt-comm-body p { margin: 0 0 10px; }
.pt-comm-body img { max-width: 100%; height: auto; border-radius: var(--pt-radius-sm); }
.pt-comm-body ul, .pt-comm-body ol { padding-left: 20px; margin: 0 0 10px; }
.pt-comm-body table { width: 100%; border-collapse: collapse; }
.pt-comm-body td, .pt-comm-body th { padding: 5px 8px; border: 1px solid var(--pt-border); }

/* ==========================================================================
   Tablet y movil (revision 2026-10-19)
   ========================================================================== */

/* Etiqueta corta del riel de tablet: oculta fuera de ese rango. */
.pt-nav-short { display: none; }

/* Tab bar: 11px en #8a94a0 no llegaba a 3:1 sobre blanco. */
.pt-tab { position: relative; font-size: .75rem; color: var(--pt-text-soft); }
.pt-tab.is-active { color: var(--pt-brand); }

/* Punto de "sin leer" en la pestana Mas y contador en la hoja. */
.pt-unseen {
	display: inline-grid; place-items: center;
	min-width: 18px; height: 18px; padding: 0 5px;
	margin-left: auto;
	border-radius: 9px;
	background: var(--pt-danger); color: #fff;
	font-size: .6875rem; font-weight: 700; line-height: 1;
}
.pt-unseen[hidden] { display: none; }
.pt-unseen--tab {
	position: absolute; top: 7px; left: calc(50% + 7px);
	min-width: 9px; height: 9px; padding: 0;
	border: 2px solid var(--pt-surface); box-sizing: content-box;
}
.pt-sheet-item.is-active { background: var(--pt-info-bg); color: var(--pt-info); font-weight: 650; }

/* Tablas: el numero de factura y las fechas no se parten en tres lineas. */
.pt-datatable .pt-cell-title,
.pt-datatable .pt-cell-sub,
.pt-datatable .pt-nowrap { white-space: nowrap; }

/* Lo que falta por pagar, debajo del total. Solo en movil, donde la columna
   Pendiente se oculta. */
.pt-cell-due { display: none; }
@media (max-width: 599px) {
	.pt-cell-due { display: block; margin-top: 2px; font-size: .75rem; font-weight: 600; color: var(--pt-danger); }
}

/* Filtros con etiqueta visible: "dd/mm/yyyy" solo no dice si es desde o hasta. */
.pt-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 0; }
.pt-field > span { font-size: .75rem; font-weight: 600; color: var(--pt-text-soft); }
/* flex: none: dentro de la etiqueta (columna) el flex-basis de 140px de
   .pt-filters .pt-input se aplicaba a la ALTURA del campo. */
.pt-filters .pt-field > .pt-input, .pt-filters .pt-field > .pt-select { width: 100%; flex: none; }
.pt-filters--stack-first { align-items: flex-end; }

/* Saldo principal del inicio y del estado de cuenta. */
.pt-total--credit { background: var(--pt-ok-bg); border-color: color-mix(in srgb, var(--pt-ok) 25%, transparent); }
.pt-total--credit .pt-total-value { color: var(--pt-ok); }
.pt-totals--single { grid-template-columns: 1fr; }
.pt-totals--single > .pt-total:last-child { grid-column: auto; }
.pt-totals-history { margin: -6px 0 16px; font-size: .8125rem; color: var(--pt-text-soft); }
.pt-totals-history b { font-weight: 600; color: var(--pt-text); }

/* En el estado de cuenta, un cargo no es una alarma: rojo solo si esta vencido. */
.pt-tl-amount.is-charge { color: var(--pt-text); }

/* Riel de tablet: el sidebar de 264px dejaba la tabla en 556px en un iPad
   vertical. Entre 768 y 1023 la navegacion pasa a una columna de 92px con
   icono y etiqueta corta; el sidebar completo vuelve desde 1024. */
@media (min-width: 768px) and (max-width: 1023px) {
	.pt-sidebar { width: 92px; padding: 14px 6px; }
	.pt-brand { justify-content: center; padding: 2px 0 14px; }
	.pt-brand-logo { max-width: 72px; height: auto; }
	.pt-brand-text { display: none; }
	.pt-nav-item {
		flex-direction: column; justify-content: center; gap: 4px;
		min-height: 56px; padding: 8px 2px;
		font-size: .6875rem; line-height: 1.15; text-align: center;
	}
	.pt-nav-item .pt-icon { width: 22px; height: 22px; }
	.pt-nav-label { display: none; }
	.pt-nav-short { display: block; }
	.pt-sidebar-foot { padding: 10px 2px 0; text-align: center; }
	.pt-whoami strong { font-size: .8125rem; }
	.pt-whoami small { display: none; }
	.pt-logout { font-size: .75rem; }
	.pt-main { padding: 20px; }
	.pt-topbar { padding: 16px 20px; }
}

/* Pagos: los dos campos de fecha comparten fila tambien en movil. */
.pt-filters--dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 480px; }

/* Estado de la factura pegado al numero, no centrado en la cabecera. */
.pt-modal-head h2 + .pt-badge { margin-right: auto; }
