/* Fundamentos visuales: variables, controles, tablas y tema. */
:root {
	--bg: #eef3f8;
	--surface: #fff;
	--surface-soft: #f7fafc;
	--glass: rgba(255, 255, 255, 0.78);
	--text: #182635;
	--muted: #657789;
	--line: #cbd8e4;
	--line-strong: #aebfce;
	--primary: #2f5f8d;
	--primary-dark: #244b72;
	--primary-soft: #e2edf7;
	--secondary: #5f7285;
	--success: #28745b;
	--warning: #9a6a20;
	--danger: #a84040;
	--shadow: 0 18px 45px rgba(32, 53, 76, 0.12);
	--radius: 8px;
	--radius-sm: 6px;
	--topbar-height: 64px;
	font-family: Inter, "Segoe UI", system-ui, sans-serif;
	color: var(--text);
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	font-size: 15px;
	line-height: 1.45;
}
h1,
h2,
p {
	margin-top: 0;
}
h1 {
	font-size: 28px;
	font-weight: 600;
	margin-bottom: 4px;
}
h2 {
	font-size: 18px;
	font-weight: 600;
}
.muted {
	color: var(--muted);
}
.eyebrow {
	margin: 0;
	color: var(--primary);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.topbar {
	height: var(--topbar-height);
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 0 clamp(16px, 3vw, 42px);
	border-bottom: 1px solid var(--line);
	background: var(--glass);
	backdrop-filter: blur(14px);
}
.brand {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--text);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.brand-mark {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: var(--radius);
	color: #fff;
	background: var(--primary);
	font-weight: 700;
}
.brand-mark.small {
	width: 30px;
	height: 30px;
	font-size: 12px;
}
.topbar nav {
	display: flex;
	gap: 4px;
	flex: 1;
}
.topbar nav button {
	padding: 7px 10px;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--secondary);
	font: inherit;
	cursor: pointer;
}
.topbar nav button:hover {
	background: var(--primary-soft);
	color: var(--primary-dark);
}
.account {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--muted);
	font-size: 13px;
}
.page-shell {
	max-width: 1540px;
	margin: 0 auto;
	padding: 30px clamp(16px, 3vw, 42px) 56px;
}
.page-heading,
.heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}
.panel,
.glass-panel {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.panel {
	padding: 22px;
	margin-bottom: 18px;
}
.glass-panel {
	background: var(--glass);
	backdrop-filter: blur(14px);
}
label {
	display: grid;
	gap: 6px;
	font-weight: 600;
	color: var(--secondary);
}
input,
select,
textarea,
button {
	font: inherit;
}
input,
select,
textarea {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	color: var(--text);
	background: var(--surface);
	outline: none;
}
textarea {
	resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-soft);
}
.btn {
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	min-height: 38px;
	padding: 7px 13px;
	cursor: pointer;
	font-weight: 600;
}
.btn:disabled {
	cursor: wait;
	opacity: 0.65;
}
.btn.primary {
	color: #fff;
	background: var(--primary);
}
.btn.primary:hover:not(:disabled) {
	background: var(--primary-dark);
}
.btn.secondary {
	background: var(--surface);
	border-color: var(--line-strong);
	color: var(--secondary);
}
.btn.ghost {
	background: transparent;
	color: var(--secondary);
}
.icon-btn {
	border: 0;
	background: transparent;
	color: var(--secondary);
	font-size: 18px;
	cursor: pointer;
}
.form-message {
	display: block;
	min-height: 1.45em;
	color: var(--danger);
	font-weight: 500;
}
.notice {
	background: var(--surface-soft);
	box-shadow: none;
}
.notice p {
	margin: 0;
	color: var(--secondary);
}
.badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 12px;
	background: var(--primary-soft);
	color: var(--primary-dark);
}
.badge.CONTABILIZADO,
.badge.CONTABILIZADO_PARCIAL {
	background: #e0f0e9;
	color: var(--success);
}
.badge.ERROR_VALIDACION,
.badge.RESULTADO_INCIERTO {
	background: #f8e4e4;
	color: var(--danger);
}
.badge.PENDIENTE_CONFIRMACION_PARCIAL {
	background: #f7eddb;
	color: var(--warning);
}
.table-shell {
	overflow: auto;
	padding: 0;
}
table {
	width: 100%;
	min-width: 760px;
	border-collapse: collapse;
}
th,
td {
	padding: 11px 12px;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: middle;
}
th {
	background: var(--surface-soft);
	font-size: 13px;
	color: var(--secondary);
}
tr:hover td {
	background: var(--surface-soft);
}
th:last-child,
td:last-child {
	border-right: 0;
}
.login {
	display: grid;
	min-height: 100vh;
	place-items: center;
	padding: 20px;
}
.login form {
	width: min(100%, 400px);
	padding: 32px;
}
.login h1 {
	display: flex;
	align-items: center;
	gap: 9px;
}
.login h1:before {
	content: "ZT";
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 8px;
	background: var(--primary);
	color: #fff;
	font-size: 14px;
}
.login h1 small {
	font-size: 17px;
	font-weight: 600;
}
.metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin-bottom: 18px;
}
.metric {
	padding: 18px;
}
.metric strong {
	display: block;
	font-size: 28px;
}
.recent-row {
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
}
.recent-row:last-child {
	border: 0;
}
.grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}
.admin-tabs {
	display: flex;
	gap: 3px;
	padding: 4px;
	margin-bottom: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}
.tab {
	border: 0;
	border-radius: var(--radius-sm);
	padding: 9px 13px;
	color: var(--secondary);
	background: transparent;
	cursor: pointer;
}
.tab:hover {
	background: var(--surface-soft);
}
.tab.active {
	color: #fff;
	background: var(--primary);
	font-weight: 600;
}
.section-panel {
	padding: 16px 18px;
	margin-bottom: 12px;
}
.section-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 13px;
}
.section-title h2 {
	margin: 0;
}
.line-grid {
	display: grid;
	grid-template-columns: 1.15fr 1.3fr 0.9fr 0.65fr 0.65fr auto;
	gap: 10px;
	padding: 0 0 15px;
	margin-bottom: 15px;
	border-bottom: 1px solid var(--line);
	align-items: end;
}
.line-grid label {
	font-size: 13px;
}
.remove {
	padding: 8px 11px;
}
.actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 18px;
	border-top: 1px solid var(--line);
	padding-top: 17px;
}
dialog {
	width: min(100% - 32px, 620px);
	padding: 24px;
	color: var(--text);
	border: 0;
	border-radius: var(--radius);
}
dialog::backdrop {
	background: rgba(24, 38, 53, 0.36);
}
.close {
	float: right;
	border: 0;
	background: transparent;
	font-size: 25px;
	color: var(--secondary);
	cursor: pointer;
}
#toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	background: var(--text);
	color: var(--surface);
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	display: none;
	z-index: 20;
}
[data-theme="dark"] {
	--bg: #121a22;
	--surface: #19242e;
	--surface-soft: #202d38;
	--glass: rgba(25, 36, 46, 0.86);
	--text: #e8eef4;
	--muted: #a8b8c7;
	--line: #334555;
	--line-strong: #4d6070;
	--primary: #6e9fca;
	--primary-dark: #91bce1;
	--primary-soft: #213e57;
	--secondary: #bbcad6;
	--success: #69b798;
	--warning: #dfad5e;
	--danger: #e48080;
	--shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}
@media (max-width: 760px) {
	.topbar {
		gap: 10px;
	}
	.topbar nav {
		display: none;
	}
	.account span {
		display: none;
	}
	.page-shell {
		padding-top: 22px;
	}
	.page-heading,
	.heading {
		align-items: flex-start;
	}
	.metrics,
	.grid {
		grid-template-columns: 1fr;
	}
	.line-grid {
		grid-template-columns: 1fr 1fr;
	}
	.line-grid label:nth-child(3) {
		grid-column: 1/3;
	}
	.admin-tabs {
		overflow: auto;
	}
	.tab {
		white-space: nowrap;
	}
	.panel {
		padding: 17px;
	}
}
