:root {
	--bg: #0f1222;
	--card: #151a2d;
	--muted: #9aa4c2;
	--text: #e6ecff;
	--accent: #5b8cff;
	--ok: #36cf82;
	--warn: #ffda6b;
	--ring: #223057;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}



body { zoom: 1; }


@media screen and (max-width: 1919px) and (hover: hover) and (pointer: fine) {
	body { zoom: 0.67; }
}


@media screen and (min-width: 1920px) {
	body { zoom: 1.25; }
}


@media screen and (min-width: 1800px) {
	.profile-avatar {
		width: 150px;
		height: 150px;
	}
}


@supports not (zoom: 1) {
	html, body { height: 100%; }

	
	@media screen and (max-width: 1919px) and (hover: hover) and (pointer: fine) {
		body {
			transform: scale(0.67);
			transform-origin: top left;
			width: calc(100% / 0.67);
			height: calc(100% / 0.67);
		}
	}

	
	@media screen and (min-width: 1920px) {
		body {
			transform: scale(1.25);
			transform-origin: top left;
			
			width: calc(100% / 1.25);
			height: calc(100% / 1.25);
		}
	}
}

.app {
	max-width: 900px;
	margin: 24px auto;
	padding: 16px;
	position: relative;
	z-index: 1;
}

h1, h2, legend { margin: 0 0 12px; }

form {
	background: var(--card);
	border: 1px solid var(--ring);
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 16px;
}

.row {
	display: grid;
	grid-template-columns: repeat(2, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

.history-filters-extra { display:flex; align-items:center; gap:10px; }
.history-hide-empty-label { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:8px; color:var(--muted); font-size:13px; }
.history-hide-empty-label input[type="checkbox"] { width:16px; height:16px; accent-color: var(--accent); margin-left:8px; }

.history-filters-extra input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 6px;
	border: 2px solid rgba(255,255,255,0.18);
	background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.10));
	display: inline-block;
	position: relative;
	vertical-align: middle;
	transition: all .12s ease;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.history-filters-extra input[type="checkbox"]:hover {
	transform: translateY(-1px);
	border-color: rgba(91,140,255,0.55);
}
.history-filters-extra input[type="checkbox"]:focus {
	outline: none;
	box-shadow: 0 0 0 5px rgba(91,140,255,0.12);
	border-color: var(--accent);
}
.history-filters-extra input[type="checkbox"]::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 1px;
	width: 6px;
	height: 10px;
	border-right: 2px solid transparent;
	border-bottom: 2px solid transparent;
	transform: rotate(45deg) scale(0.8);
	opacity: 0;
	transition: all .14s ease;
}
.history-filters-extra input[type="checkbox"]:checked {
	background: linear-gradient(180deg, #6ea7ff, var(--accent));
	border-color: rgba(30,60,120,0.6);
}
.history-filters-extra input[type="checkbox"]:checked::after {
	border-right-color: white;
	border-bottom-color: white;
	left: 5px;
	top: 3px;
	opacity: 1;
	transform: rotate(45deg) scale(1);
}

@media (max-width:420px) {
	.history-filters-extra input[type="checkbox"] { width:16px; height:16px; border-radius:5px; }
}
.row .full { grid-column: 1 / -1; }

label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="date"] {
	background: #0e1324;
	color: var(--text);
	border: 1px solid var(--ring);
	border-radius: 8px;
	padding: 10px 12px;
}


input[type="date"] {
  color: var(--text);
  caret-color: var(--text);
  color-scheme: dark; 
}
input[type="date"]::-webkit-datetime-edit { color: var(--text); }
input[type="date"]::-webkit-datetime-edit-text { color: var(--text); opacity: 1; }
input[type="date"]::-webkit-datetime-edit-day-field { color: var(--text); }
input[type="date"]::-webkit-datetime-edit-month-field { color: var(--text); }
input[type="date"]::-webkit-datetime-edit-year-field { color: var(--text); }


input[type="date"]:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}


input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1); 
}

fieldset {
	border: 1px dashed var(--ring);
	border-radius: 8px;
	padding: 10px 12px 4px;
	margin-bottom: 12px;
}

.sites {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
}

.site-item {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #0e1324;
	border: 1px solid var(--ring);
	border-radius: 8px;
	padding: 8px 10px;
	color: var(--text);
}

.actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

button {
	background: var(--accent);
	color: white;
	border: none;
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
button:hover:not(:disabled) {
	transform: translateY(-1px);
}
button:disabled { opacity: .6; cursor: not-allowed; }
#limpar { background: #2b3352; }
#parar { background: #e53935; }

.resultados, .resumo {
	background: var(--card);
	border: 1px solid var(--ring);
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 14px;
}

.tab-btn {
	background: linear-gradient(180deg, rgba(91,140,255,0.14), rgba(91,140,255,0.06));
	color: var(--text);
	border: 1px solid rgba(91,140,255,0.12);
	padding: 8px 12px;
	border-radius: 8px;
	cursor: pointer;
}
.history-main { background: var(--card); border: 1px solid var(--ring); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.history-progress { display:flex; flex-direction:column; gap:8px; }
.progress-label { color: var(--muted); font-weight:700; }
.progress-bar-wrapper { background: rgba(255,255,255,0.03); border-radius: 8px; height: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,0.02); }
.progress-bar { height: 100%; background: linear-gradient(90deg,#78d2ff,#4aa8ff); width:0%; transition: width .45s ease; }
.history-main.hidden { display:none; }

.history-main.progress-active #history-main-content { display: none; }

.logs {
	background: #0e1324;
	border: 1px solid var(--ring);
	border-radius: 8px;
	height: 300px;
	max-height: unset;
	min-height: unset;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 10px;
}

.log-line {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 13px;
	padding: 4px 0;
	border-bottom: 1px dashed rgba(255,255,255,0.06);
	animation: fadeInUp .18s ease-out;
}

#totais p { margin: 6px 0; }
#totais strong { color: var(--ok); }

.profilebar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--card);
	border: 1px solid var(--ring);
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 14px;
}
.profile-actions { display: flex; gap: 8px; }

#history-overlay .overlay {
  background: rgba(0,0,0,0.85); 
}
#history-overlay {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay {
	position: fixed;
	inset: 0;
	background: #00061a; 
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 1000;
	overflow: auto; 
}
.overlay.hidden { display: none; }
.overlay-card {
	background: var(--card);
	border: 1px solid var(--ring);
	border-radius: 12px;
	padding: 16px;
	max-width: 760px;
	width: 100%;
	max-height: 92vh;   
	overflow: auto;     
	animation: pop .18s ease-out;
}
/* HAHAHAAAA CUCETA */
.shake {
  animation: shake .36s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}


#history-container {
  height: auto !important;
  max-height: 55vh;   
  overflow: auto;
}
@media (max-width: 768px) {
	.overlay-card { max-height: 96vh; }
	#history-container { max-height: 65vh; }
}

@media (max-width: 420px) {
	#history-overlay.overlay, #history-overlay {
		padding: 0 !important;
		margin: 0 !important;
		inset: 0 !important;
		width: 100% !important;
		height: 100% !important;
	}

	#history-overlay .overlay-card {
		position: fixed;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		max-height: none;
		margin: 0;
		border-radius: 0;
		padding: 14px;
		overflow: auto;
		display: flex;
		flex-direction: column;
	}

	#history-container {
		flex: 1 1 auto;
		max-height: none;
		height: auto;
		overflow: auto;
		padding: 6px 2px;
	}

	#history-overlay .overlay-card .actions {
		display: flex;
		gap: 8px;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 8px;
	}
}

@media (max-width: 420px) {
	.overlay-card {
		max-width: calc(100% - 24px);
		width: calc(100% - 24px);
		padding: 18px;
		border-radius: 10px;
	}

	#history-container {
		max-height: 78vh;
		padding: 8px 4px;
		font-size: 15px;
		line-height: 1.45;
	}

	.logs .log-line {
		padding: 10px 8px;
		border-radius: 8px;
		background: rgba(255,255,255,0.02);
		margin-bottom: 8px;
		display: block;
		word-break: break-word;
	}

	#history-filters .row label {
		display: block;
		width: 100%;
		margin-bottom: 10px;
	}

	.history-filters-extra { width: 100%; }
	.history-hide-empty-label { width: 100%; justify-content:space-between; }
	#history-filters .actions { display:flex; gap:8px; flex-wrap:wrap; }
	#history-filters select, #history-filters input {
		width: 100%;
		box-sizing: border-box;
		font-size: 14px;
		padding: 8px 10px;
	}

	.overlay-card .actions button {
		padding: 10px 12px;
		font-size: 14px;
	}
}

@media (max-width: 760px) and (min-width: 421px) {
	#history-container {
		max-height: 75vh;
		font-size: 14px;
		line-height: 1.4;
	}
	.logs .log-line { padding: 9px 8px; margin-bottom: 7px; }
	.overlay-card { padding: 16px; }
}

.profiles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 18px;
	margin: 16px 0;
}
.profile-tile {
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	user-select: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
.profile-avatar {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid transparent;
	box-shadow: 0 0 0 2px var(--ring);
	transition: transform .15s ease, box-shadow .15s ease;
}

.logged-profile {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.profile-left {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}
.profile-right {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	flex: 1 1 auto;
	padding-top: 4px;
}
.small-avatar {
	width: 72px;
	height: 72px;
}
.logged-balances {
    font-size: 15px;
    font-weight: 600;
    margin-top: 6px;
    width: 72px;
    text-align: left;
}

.logged-balances-timer {
	color: var(--muted);
	font-size: 12px;
	text-align: center;
	width: 100%;
}

.refresh-balances-mini {
	font-size: 12px;
	color: var(--muted);
	background: transparent;
	border: 1px solid rgba(255,255,255,0.04);
	padding: 6px 8px;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}
.refresh-balances-mini:hover { border-color: rgba(255,255,255,0.08); }

.balance-item {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	width: 100%;
	line-height: 1.1;
}
.balance-site {
	color: var(--muted);
	font-weight: 600;
	margin-right: 6px;
}
.balance-value {
	min-width: 1ch;
	white-space: nowrap;
	text-align: right;
}
.logged-name {
    font-weight: 700;
}
.logged-sub { font-size: 12px; }

.profile-avatar.is-currently-logged {
	border-color: var(--ok);
	box-shadow: 0 0 0 3px rgba(54,207,130,0.18), 0 6px 18px rgba(0,0,0,.4);
}
.profile-tile:hover .profile-avatar {
	transform: scale(1.05);
	box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(0,0,0,.35);
}
.profile-tile--online {
	border-radius: 10px;
}
.profile-tile--online .profile-avatar {
	border-color: var(--ok);
	box-shadow: 0 0 0 3px rgba(54,207,130,0.18), 0 6px 18px rgba(0,0,0,.4);
}

.profile-online-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 12px;
	height: 12px;
	background: var(--ok);
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(54,207,130,0.12);
	display: inline-block;
}

.profile-tile { position: relative; }
.profile-name {
	font-weight: 600;
}

.identity-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin: 12px 0 8px;
}
.identity-item {
	display: grid;
	gap: 6px;
	background: #0e1324;
	border: 1px solid var(--ring);
	border-radius: 10px;
	padding: 10px;
}
.identity-item label {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}
.identity-item input[type="text"] {
	width: 100%;
}
.muted { color: var(--muted); font-size: 13px; }

.password-dialog {
	background: var(--card);
	border: 1px solid var(--accent);
	border-radius: 10px;
	padding: 20px;
	text-align: center;
	width: 300px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
	animation: pop .18s ease-out;
}

.password-avatar {
	width: 100px;
	height: 100px;
	margin-bottom: 5px;
}

.password-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid var(--accent);
	box-shadow: 0 0 10px rgba(91, 140, 255, 0.3);
	
}

.profile-stars {
	position: absolute;
	inset: 0;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	z-index: 600;
}
.profile-stars .star {
	position: absolute;
	display: block;
	width: var(--s, 8px);
	height: var(--s, 8px);
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, rgba(255,255,255,1) 0%, rgba(255,255,255,0.85) 30%, rgba(255,255,255,0.3) 60%, rgba(255,255,255,0) 100%);
	filter: drop-shadow(0 0 8px rgba(255,255,255,0.35));
	opacity: 0;
	transform: translateY(30px) scale(0.6);
	animation: starRise var(--dur, 2800ms) cubic-bezier(.2,.9,.3,1) forwards;
}

@keyframes starRise {
	0% {
		opacity: 0;
		transform: translateY(30px) scale(0.6) rotate(0deg);
	}
	8% { opacity: 1; }
	60% {
		opacity: 0.9;
	}
	100% {
		opacity: 0;
		transform: translateY(-140%) scale(1.0) rotate(90deg);
	}
}

.profile-stars .star::before {
	content: '';
	position: absolute;
	left: 0; top: 0; right: 0; bottom: 0;
	border-radius: 50%;
	box-shadow: 0 0 6px rgba(255,255,255,0.08) inset;
}

@media (max-width: 600px) {
	.profile-stars .star { --s: 6px; }
}

#profile-password {
	background: #0e1324;
	color: var(--text);
	border: 1px solid var(--ring);
	border-radius: 8px;
	padding: 10px 12px;
	text-align: center;
	font-size: 20px;
	letter-spacing: 4px;
	width: 140px;
}

.password-dialog h3 {
	margin: 0;
	font-size: 18px;
}

.password-dialog input {
	padding: 10px;
	border-radius: 8px;
	margin: 10px 0;
}

.password-dialog button {
	margin-top: 10px;
}

.password-error {
	color: #ff4d4f;
	font-size: 14px;
	margin-top: 8px;
}

.login-btn {
	background: var(--accent);
}

.cancel-btn {
	background: #2b3352;
}

.password-buttons {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding-right: 40px; 
}

.icon-button {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  width: 24px;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}


.badge {
	display: inline-block;
	background: rgba(255,255,255,0.06);
	color: var(--text);
	padding: 2px 6px;
	border-radius: 6px;
	font-size: 12px;
	margin-left: 8px;
}
.badge.deposit { background: #bc364f; color: #fff; }
.badge.raw { background: #1f7a8c; color: #fff; }

.hidden {
  display: none;
}


.date-toggle {
  color: white;
}


.password-dialog #profile-password {
  padding-right: 40px;
}


#taxa-label,
#taxa {
  color: #ff4d4f !important;
}

#taxas-outros {
  margin-top: 10px; 
}


@keyframes pop {
	from { opacity: 0; transform: translateY(8px) scale(.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.overlay:not(.hidden) .overlay-card,
.overlay:not(.hidden) .password-dialog {
	animation: pop .18s ease-out;
}


@keyframes fadeInUp {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}


@keyframes spin { to { transform: rotate(360deg); } }


@keyframes flashBg {
	0%   { filter: brightness(1.6); }
	100% { filter: brightness(1); }
}


@keyframes profilePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.profile-tile.is-entering .profile-avatar {
  animation: profilePulse .22s ease-out;
  box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(91,140,255,.35);
}


@keyframes appReveal {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.just-logged .app {
  animation: appReveal .24s ease-out;
}


@keyframes moneyUp {
  0%   { transform: scale(1); filter: brightness(1); }
  40%  { transform: scale(1.08); filter: brightness(1.35); }
  100% { transform: scale(1); filter: brightness(1); }
}
.money-up {
  animation: moneyUp .55s ease-out;
  text-shadow: 0 0 10px rgba(54,207,130,.35);
}

@media (max-width: 760px) {
	.row { grid-template-columns: 1fr 1fr; }
}


@media (max-width: 768px) {
	
	body { zoom: 1 !important; }
	@supports not (zoom: 1) {
		html, body { height: auto; }
		body {
			transform: none !important;
			width: auto !important;
			height: auto !important;
		}
	}

	.app { max-width: 100%; padding: 12px; }

	.row { grid-template-columns: 1fr; }

	.sites {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.actions {
		flex-direction: column;
		gap: 8px;
	}
	.actions button { width: 100%; }

	.overlay { padding: 12px; }
	.overlay-card { max-width: 100%; width: 100%; padding: 14px; max-height: 96vh; }

	.logs {
		height: 40vh;
		max-height: none;
		min-height: 0;
	}

	.password-dialog { width: 92%; padding: 16px; }
	#profile-password { width: 100%; max-width: 240px; }
}


@media (max-width: 420px) {
	.sites { grid-template-columns: 1fr; }

	.profiles-grid {
		grid-template-columns: repeat(2, minmax(100px, 1fr));
		gap: 12px;
	}
	.profile-avatar { width: 90px; height: 90px; }

	.input-with-icon input { padding-right: 36px; }
	.icon-button { right: 6px; height: 22px; width: 22px; }
}


.locked { overflow: hidden; }
.locked .app > *:not(#profile-overlay):not(#password-overlay) {
	display: none !important;
}

.heal-effect {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	mix-blend-mode: screen;
	overflow: visible;
}
.heal-effect.hidden { display: none; }
.heal-effect .heal-bg {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, rgba(120,200,255,0.12) 0%, rgba(40,90,160,0.08) 30%, transparent 60% ), linear-gradient(180deg, rgba(100,190,255,0.06), rgba(40,80,140,0.02));
	backdrop-filter: blur(6px);
}
.heal-effect .particles {
	position: absolute;
	inset: 0;
	overflow: hidden;
}
.heal-effect .particle {
	position: absolute;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.95), rgba(180,230,255,0.9) 40%, rgba(120,200,255,0.6));
	box-shadow: 0 0 10px rgba(140,220,255,0.7), 0 0 20px rgba(80,170,255,0.25);
	opacity: 0;
	transform: translate3d(0,0,0) scale(.6);
}

@keyframes particleRise {
	0% { transform: translateX(var(--drift, 0)) translateY(10px) scale(.6); opacity: 0; }
	10% { opacity: 1; }
	100% { transform: translateX(calc(var(--drift, 0))) translateY(-260px) scale(1.08); opacity: 0; }
}

.heal-glow {
	position: absolute;
	left: 12px;
	top: 8px;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(circle, rgba(150,230,255,0.18) 0%, rgba(90,180,255,0.08) 40%, transparent 60%);
	filter: blur(12px);
	transform-origin: center;
	animation: healPulse 1.6s ease-in-out infinite;
}

@keyframes healPulse {
	0% { transform: scale(.95); opacity: .9; }
	50% { transform: scale(1.08); opacity: 1; }
	100% { transform: scale(.95); opacity: .9; }
}



#history-overlay .overlay-card {
  transform: scale(0.8);
  transform-origin: center center; 
}


.history-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.history-table thead th.sortable .arrow {
  margin-left: 6px;
  opacity: .7;
  font-size: 11px;
}


#history-container {
  height: auto !important;
  max-height: 45vh;   
  overflow: auto;
}


.history-table {
  width: 100%;
  border-collapse: collapse;
  background: #0e1324;
  border: 1px solid var(--ring);
  border-radius: 8px;
  overflow: hidden;
}
.history-table thead th {
  position: sticky;
  top: 0;
  background: #10162a;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--ring);
}
.history-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 13px;
  vertical-align: middle;
}
.history-table tbody tr:hover {
  background: rgba(91,140,255,0.06);
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: white;
  background: #2b3352;
  margin-left: 6px;
}


#history-filters select {
  -webkit-appearance: none;
  appearance: none;
  background-color: #0e1324;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 36px 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#history-filters select:hover {
  border-color: var(--accent);
}
#history-filters select:focus {
  box-shadow: 0 0 0 2px rgba(91,140,255,.25);
  border-color: var(--accent);
}


#history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 6px 0 8px;
}
#history-meta .hist-total {
  color: var(--ok);
  font-weight: 700;
  white-space: nowrap;
}


@media (max-width: 768px) {
  #history-container { max-height: 60vh; }
  .history-table thead { display: none; }
  .history-table, .history-table tbody, .history-table tr, .history-table td {
    display: block;
    width: 100%;
  }
  .history-table tr { border-bottom: 1px solid var(--ring); }
  .history-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .history-table td::before {
    content: attr(data-label);
    color: var(--muted);
  }
}


#history-overlay .overlay-card > .actions:last-child {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--card);
  border-top: 1px solid var(--ring);
  padding: 8px 0;
  
  display: flex;
  justify-content: flex-end !important;
}


@media (max-width: 768px) {
  #history-overlay .overlay-card > .actions:last-child {
    box-shadow: 0 -8px 16px rgba(0,0,0,.35);
  }
}

.heal-effect .center-glow {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 680px;
	height: 420px;
	pointer-events: none;
	border-radius: 50%;
	background: radial-gradient(circle at 45% 40%, rgba(220,250,255,0.22) 0%, rgba(160,230,255,0.12) 25%, rgba(60,140,220,0.04) 55%, transparent 70%);
	filter: blur(36px) saturate(1.2);
	opacity: 0.95;
	mix-blend-mode: screen;
	animation: centerFlare 3.8s ease-in-out infinite;
}

@keyframes centerFlare {
	0% { transform: translate(-50%, -50%) scale(0.98); opacity: .86; }
	50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
	100% { transform: translate(-50%, -50%) scale(0.98); opacity: .86; }
}


@media (max-width: 420px) {
	#history-overlay.overlay, #history-overlay {
		position: fixed !important;
		inset: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		width: 100% !important;
		height: 100% !important;
	}

	#history-overlay.overlay .overlay-card,
	#history-overlay .overlay-card {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		top: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		border-radius: 0 !important;
		padding: 14px !important;
		overflow: auto !important;
		display: flex !important;
		flex-direction: column !important;
	}

	#history-container {
		flex: 1 1 auto !important;
		max-height: none !important;
		height: auto !important;
		overflow: auto !important;
	}
}

@media (max-width: 480px) {
	#history-overlay-mobile.overlay, #history-overlay-mobile {
		position: fixed !important;
		inset: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		width: 100% !important;
		height: 100% !important;
		z-index: 1100;
	}

	.overlay-card-mobile {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		top: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		border-radius: 0 !important;
		padding: 12px !important;
		overflow: auto !important;
		display: flex !important;
		flex-direction: column !important;
		background: linear-gradient(180deg, rgba(10,12,20,0.96), rgba(7,9,16,0.98));
	}

	#history-container-mobile {
		flex: 1 1 auto !important;
		overflow: auto !important;
		padding: 6px 4px !important;
		font-size: 15px !important;
		line-height: 1.45 !important;
	}
}

	@media (max-width: 480px) {
		#history-meta-mobile {
			display: block;
			padding: 6px 4px;
			font-size: 14px;
			color: var(--muted);
		}

		@media (max-width: 480px) {
			.mobile-filter-toggle {
				display: inline-block;
				background: rgba(255,255,255,0.03);
				color: var(--text);
				border: 1px solid rgba(255,255,255,0.04);
				padding: 8px 10px;
				border-radius: 8px;
				font-weight: 700;
				margin-bottom: 8px;
				cursor: pointer;
			}
			.mobile-filters {
				background: rgba(14,19,36,0.9);
				border: 1px solid var(--ring);
				border-radius: 10px;
				padding: 10px;
				margin-bottom: 10px;
				display: block;
			}
			.mobile-filters.hidden { display: none; }
			.mobile-filters .row { grid-template-columns: 1fr; gap: 8px; }
			.mobile-filters label { width: 100%; }
			.mobile-filters select { width: 100%; }
			.mobile-filters .actions { display:flex; gap:8px; justify-content:flex-end; }
		}

			@media (max-width: 480px) {
				.mobile-filters select {
					appearance: none;
					-webkit-appearance: none;
					background-color: #0e1324;
					border: 1px solid var(--ring);
					color: var(--text);
					padding: 10px 12px;
					border-radius: 8px;
					box-shadow: none;
					background-image: url("data:image/svg+xml;utf8,<svg fill='white' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
					background-repeat: no-repeat;
					background-position: right 10px center;
					background-size: 14px;
				}

				.mobile-filters .mobile-filter-toggle {
					transition: transform .18s ease, opacity .12s ease;
				}

				.mobile-filters.closing {
					transition: opacity .22s ease, transform .22s ease;
					opacity: 0;
					transform: translateY(-6px) scale(.995);
				}
			}
		#history-meta-mobile .hist-total { color: var(--ok); font-weight:700; }
		#history-meta-mobile span[title*="Depósitos"] { color: #bc364f; font-weight:700; }
	}