/**
 * rg-boleto.css — Portal 2ª Via de Boleto
 *
 * Cobre:
 *   /segunda-via-boleto/ — consulta pública (Figma 3:102, 3:19, 3:299)
 *   /area-financeiro/    — backoffice financeiro (Figma 3:1074, 3:1138, 3:1375, 3:1517, 3:1665, 3:1901)
 *
 * Usa tokens de var(--rg-*) definidos em rg-global.css.
 * Nunca hardcodar cor, tamanho ou fonte fora dos tokens.
 *
 * @since 2026-03-31
 */


/* =============================================================================
   LAYOUT BASE — ambas as páginas
   ============================================================================= */

.rg-boleto-page {
	min-height: 100vh;
	background: var(--rg-color-bg-gray);
	font-family: var(--rg-font-body);
	color: var(--rg-color-text);
}


/* =============================================================================
   PÁGINA PÚBLICA — /segunda-via-boleto/
   ============================================================================= */

/* --- Hero strip --- */
.rg-boleto-hero {
	background: var(--rg-color-primary);
	color: #fff;
	text-align: center;
	padding: 56px var(--rg-space-8) 80px; /* bottom extra para o card invadir */
}

.rg-boleto-hero__title {
	font-family: var(--rg-font-heading) !important;
	font-size: var(--rg-text-2xl) !important;
	font-weight: var(--rg-font-weight-bold) !important;
	margin: 0 0 var(--rg-space-2) !important;
	color: #fff !important;  /* !important sobrescreve Elementor global H1 */
}

.rg-boleto-hero__sub {
	font-size: var(--rg-text-base);
	color: rgba(255,255,255,0.82);
	margin: 0;
}

/* --- Container público (card invade o hero) --- */
.rg-boleto-public {
	max-width: 520px;
	margin: -60px auto 0; /* puxa o card 60px para dentro do hero */
	padding: 0 var(--rg-space-4) var(--rg-space-16);
}

/* --- Card genérico do portal --- */
.rg-boleto-card {
	background: #fff;
	border-radius: var(--rg-radius);
	box-shadow: 0 8px 32px rgba(0, 5, 81, 0.14), 0 2px 8px rgba(0,0,0,0.08);
	padding: var(--rg-space-8);
	margin-bottom: var(--rg-space-4);
	position: relative;
	z-index: 1;
}

/* --- Formulário de consulta --- */
.rg-boleto-form__eyebrow {
	font-size: var(--rg-text-xs);
	font-weight: var(--rg-font-weight-bold);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--rg-color-primary);
	margin: 0 0 var(--rg-space-1);
}

.rg-boleto-form__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-xl);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-primary);
	margin: 0 0 var(--rg-space-5);
}

.rg-boleto-form__sub {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-secondary);
	margin: 0 0 var(--rg-space-6);
}

/* Badge de segurança abaixo do botão */
.rg-boleto-security {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--rg-space-1);
	margin-top: var(--rg-space-3);
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
}

.rg-boleto-field {
	margin-bottom: var(--rg-space-4);
}

.rg-boleto-field label,
.rg-boleto-page .rg-boleto-field label {
	display: block;
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
	margin-bottom: var(--rg-space-1);
	text-decoration: none;
}

.rg-boleto-field input {
	width: 100%;
	padding: 12px var(--rg-space-4);
	border: 1px solid var(--rg-color-border);
	border-radius: var(--rg-radius);
	font-family: var(--rg-font-body);
	font-size: var(--rg-text-base);
	color: var(--rg-color-text);
	background: #fff;
	transition: border-color 0.15s ease;
	box-sizing: border-box;
}

.rg-boleto-field input:focus {
	outline: none;
	border-color: var(--rg-color-primary);
	box-shadow: 0 0 0 2px rgba(0, 5, 81, 0.12);
}

.rg-boleto-field input.is-error {
	border-color: var(--rg-color-error);
}

.rg-boleto-field__hint {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin-top: var(--rg-space-1);
}

.rg-boleto-btn,
.rg-boleto-page .rg-boleto-btn {
	display: block !important;
	width: 100% !important;
	padding: 14px 32px !important; /* Elementor Kit 31 sets padding:0 — override */
	background: var(--rg-color-primary) !important; /* Kit sets var(--e-global-color-accent)=#2FC89B — override */
	color: #fff !important;
	font-family: var(--rg-font-heading) !important;
	font-size: var(--rg-text-base) !important;
	font-weight: var(--rg-font-weight-bold) !important;
	border: none !important;
	border-radius: var(--rg-radius) !important; /* Kit sets border-radius:26.5px — override */
	cursor: pointer !important;
	text-align: center !important;
	transition: opacity 0.15s ease;
	margin-top: var(--rg-space-4);
	text-decoration: none !important;
	box-shadow: none !important;
	line-height: 1.5 !important; /* Kit overrides line-height */
}

.rg-boleto-btn:hover:not(:disabled),
.rg-boleto-page .rg-boleto-btn:hover:not(:disabled) {
	opacity: 0.88;
	background: var(--rg-color-primary) !important;
	color: #fff !important;
}

.rg-boleto-btn:disabled,
.rg-boleto-page .rg-boleto-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rg-boleto-btn--success,
.rg-boleto-page .rg-boleto-btn--success {
	background: var(--rg-color-success) !important;
}

.rg-boleto-btn--outline,
.rg-boleto-page .rg-boleto-btn--outline {
	background: transparent !important;
	border: 2px solid var(--rg-color-primary) !important;
	color: var(--rg-color-primary) !important;
}

/* --- WhatsApp support card --- */
.rg-boleto-whatsapp {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--rg-space-3);
	background: #fff;
	border-radius: var(--rg-radius);
	border: 1px solid var(--rg-color-border);
	padding: var(--rg-space-4);
	text-decoration: none !important;
	color: inherit;
	transition: box-shadow 0.15s ease;
	position: relative;
	z-index: 1;
}

.rg-boleto-whatsapp:hover {
	box-shadow: var(--rg-shadow);
	text-decoration: none !important;
}

.rg-boleto-whatsapp__left {
	display: flex;
	align-items: center;
	gap: var(--rg-space-3);
}

.rg-boleto-whatsapp__icon {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	background: #25D366;
	border-radius: var(--rg-radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
}

.rg-boleto-whatsapp__icon svg {
	width: 22px;
	height: 22px;
	fill: #fff;
}

.rg-boleto-whatsapp__label {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin-bottom: 2px;
}

.rg-boleto-whatsapp__text {
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
}

.rg-boleto-whatsapp__cta {
	flex-shrink: 0;
	padding: 8px 16px;
	background: var(--rg-color-success) !important;
	color: #fff !important;
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-xs);
	font-weight: var(--rg-font-weight-bold);
	border: none !important;
	border-radius: var(--rg-radius);
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none !important;
	display: inline-flex;
	align-items: center;
	transition: opacity 0.15s ease;
}

.rg-boleto-whatsapp__cta:hover {
	opacity: 0.88;
	color: #fff !important;
	text-decoration: none !important;
}


/* =============================================================================
   ESTADO — BOLETO ENCONTRADO (Figma 3:19)
   ============================================================================= */

.rg-boleto-found {
	background: #fff;
	border-radius: var(--rg-radius);
	box-shadow: var(--rg-shadow);
	overflow: hidden;
}

.rg-boleto-found__bar {
	height: 6px;
	background: var(--rg-color-success);
}

.rg-boleto-found__body {
	padding: var(--rg-space-6) var(--rg-space-8);
}

.rg-boleto-found__icon {
	width: 48px;
	height: 48px;
	background: var(--rg-color-success);
	border-radius: var(--rg-radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--rg-space-4);
}

.rg-boleto-found__icon svg {
	width: 26px;
	height: 26px;
	fill: #fff;
}

.rg-boleto-found__heading {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-lg);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-primary);
	margin: 0 0 var(--rg-space-4);
}

.rg-boleto-found__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--rg-space-3);
	margin-bottom: var(--rg-space-6);
}

@media (max-width: 480px) {
	.rg-boleto-found__grid {
		grid-template-columns: 1fr;
	}
}

.rg-boleto-found__field {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rg-boleto-found__field-label {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.rg-boleto-found__field-value {
	font-size: var(--rg-text-base);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
}

.rg-boleto-found__field-value--valor {
	font-size: var(--rg-text-xl);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-success);
}

.rg-boleto-found__field-value--name {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-secondary);
}

.rg-boleto-found__expires {
	display: inline-flex;
	align-items: center;
	gap: var(--rg-space-1);
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin-bottom: var(--rg-space-4);
}

.rg-boleto-found__expires-dot {
	width: 6px;
	height: 6px;
	border-radius: var(--rg-radius-full);
	background: var(--rg-color-success);
	animation: rg-pulse 1.5s ease-in-out infinite;
}

@keyframes rg-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.3; }
}

.rg-boleto-found__back {
	display: block;
	text-align: center;
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-muted) !important; /* Kit green override */
	margin-top: var(--rg-space-3);
	cursor: pointer;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	border-radius: 0 !important;
	text-decoration: underline;
}

.rg-boleto-found__back:hover {
	color: var(--rg-color-primary) !important;
}


/* =============================================================================
   ESTADOS DE ERRO (Figma 3:299)
   ============================================================================= */

.rg-boleto-error {
	background: #fff;
	border-radius: var(--rg-radius);
	border-left: 4px solid var(--rg-color-border);
	padding: var(--rg-space-5) var(--rg-space-6);
	margin-bottom: var(--rg-space-3);
}

.rg-boleto-error--not-found {
	border-left-color: var(--rg-color-error);
}

.rg-boleto-error--rate-limit {
	border-left-color: var(--rg-color-primary);
}

.rg-boleto-error--unavailable {
	border-left-color: var(--rg-color-primary-light);
}

.rg-boleto-error__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-md);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-1);
}

.rg-boleto-error__desc {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-secondary);
	margin: 0 0 var(--rg-space-3);
}

.rg-boleto-error__countdown {
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-primary);
}

.rg-boleto-error__back {
	display: inline-flex;
	align-items: center;
	gap: var(--rg-space-1);
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-primary) !important; /* Kit green override */
	background: none !important;
	border: none !important;
	cursor: pointer;
	padding: 0 !important;
	border-radius: 0 !important;
	text-decoration: underline;
}


/* =============================================================================
   LOADING SPINNER
   ============================================================================= */

.rg-boleto-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: var(--rg-radius-full);
	animation: rg-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: var(--rg-space-2);
}

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


/* =============================================================================
   BACKOFFICE FINANCEIRO — /area-financeiro/
   ============================================================================= */

/* --- Layout dois colunas: sidebar + main --- */
.rg-fin-layout {
	display: flex;
	min-height: 100vh;
}

.rg-fin-sidebar {
	width: 240px;
	flex-shrink: 0;
	background: var(--rg-color-primary);
	display: flex;
	flex-direction: column;
	padding: var(--rg-space-6) 0;
}

.rg-fin-sidebar__logo {
	padding: 0 var(--rg-space-5) var(--rg-space-6);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	margin-bottom: var(--rg-space-4);
}

.rg-fin-sidebar__logo-text {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-bold);
	color: #fff;
	letter-spacing: 0.04em;
}

.rg-fin-sidebar__label {
	font-size: var(--rg-text-xs);
	color: rgba(255, 255, 255, 0.45);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0 var(--rg-space-5);
	margin-bottom: var(--rg-space-2);
}

.rg-fin-nav {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rg-fin-nav__item a {
	display: flex;
	align-items: center;
	gap: var(--rg-space-3);
	padding: var(--rg-space-3) var(--rg-space-5);
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: rgba(255, 255, 255, 0.7) !important; /* Kit link color override */
	text-decoration: none !important;
	background: transparent !important;
	border-left: 3px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.rg-fin-nav__item a:hover,
.rg-fin-nav__item.is-active a {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.08) !important;
	border-left-color: var(--rg-color-accent);
}

.rg-fin-nav__item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	opacity: 0.7;
}

.rg-fin-nav__item.is-active svg,
.rg-fin-nav__item a:hover svg {
	opacity: 1;
}

.rg-fin-sidebar__footer {
	margin-top: auto;
	padding: var(--rg-space-4) var(--rg-space-5) 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.rg-fin-sidebar__user {
	font-size: var(--rg-text-xs);
	color: rgba(255, 255, 255, 0.5);
	margin-bottom: var(--rg-space-2);
}

.rg-fin-sidebar__logout {
	font-size: var(--rg-text-sm);
	color: rgba(255, 255, 255, 0.65) !important; /* Kit link color override */
	text-decoration: none !important;
}

.rg-fin-sidebar__logout:hover {
	color: #fff !important;
}

/* --- Main content --- */
.rg-fin-main {
	flex: 1;
	min-width: 0;
	background: var(--rg-color-bg-gray);
	overflow-y: auto;
}

.rg-fin-topbar {
	background: #fff;
	border-bottom: 1px solid var(--rg-color-border);
	padding: var(--rg-space-4) var(--rg-space-8);
	display: flex;
	align-items: center;
	gap: var(--rg-space-4);
}

.rg-fin-topbar__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-lg);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-primary);
	margin: 0;
}

.rg-fin-content {
	padding: var(--rg-space-8);
}

/* --- Mobile: colapsar sidebar --- */
@media (max-width: 768px) {
	.rg-fin-layout {
		flex-direction: column;
	}

	.rg-fin-sidebar {
		width: 100%;
		padding: var(--rg-space-4) 0;
	}

	.rg-fin-nav__item a {
		border-left: none;
		border-bottom: 2px solid transparent;
	}

	.rg-fin-nav__item.is-active a {
		border-bottom-color: var(--rg-color-accent);
		border-left-color: transparent;
	}

	.rg-fin-content {
		padding: var(--rg-space-4);
	}
}


/* =============================================================================
   UPLOAD ZONE (Figma 3:1665)
   ============================================================================= */

.rg-boleto-upload-zone {
	border: 2px dashed var(--rg-color-border);
	border-radius: var(--rg-radius-lg);
	padding: var(--rg-space-16) var(--rg-space-8);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
	background: #fff;
	margin-bottom: var(--rg-space-6);
}

.rg-boleto-upload-zone:hover,
.rg-boleto-upload-zone.is-dragover {
	border-color: var(--rg-color-primary);
	background: rgba(0, 5, 81, 0.03);
}

.rg-boleto-upload-zone.is-dragover {
	background: rgba(0, 5, 81, 0.06);
}

.rg-boleto-upload-zone__icon {
	width: 56px;
	height: 56px;
	background: var(--rg-color-bg-gray);
	border-radius: var(--rg-radius-lg);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--rg-space-4);
}

.rg-boleto-upload-zone__icon svg {
	width: 28px;
	height: 28px;
	color: var(--rg-color-primary);
}

.rg-boleto-upload-zone__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-md);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-1);
}

.rg-boleto-upload-zone__sub {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-muted);
	margin: 0 0 var(--rg-space-4);
}

.rg-boleto-upload-zone__browse {
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-primary);
	text-decoration: underline;
	cursor: pointer;
}

.rg-boleto-upload-zone__input {
	display: none;
}

.rg-boleto-upload-progress {
	background: var(--rg-color-bg-gray);
	border-radius: var(--rg-radius);
	height: 4px;
	overflow: hidden;
	margin-top: var(--rg-space-3);
}

.rg-boleto-upload-progress__bar {
	height: 100%;
	background: var(--rg-color-primary);
	transition: width 0.3s ease;
	width: 0%;
}


/* =============================================================================
   TABELA DE HISTÓRICO (uploads + acessos)
   ============================================================================= */

.rg-fin-table-wrap {
	background: #fff;
	border-radius: var(--rg-radius);
	box-shadow: var(--rg-shadow);
	overflow: hidden;
}

.rg-fin-table-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--rg-space-5) var(--rg-space-6);
	border-bottom: 1px solid var(--rg-color-border);
	gap: var(--rg-space-4);
}

.rg-fin-table-head__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-md);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-primary);
	margin: 0;
}

.rg-fin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--rg-text-sm);
}

.rg-fin-table thead th {
	text-align: left;
	padding: var(--rg-space-3) var(--rg-space-4);
	font-size: var(--rg-text-xs);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid var(--rg-color-border);
	white-space: nowrap;
}

.rg-fin-table tbody tr {
	border-bottom: 1px solid var(--rg-color-border-light);
}

.rg-fin-table tbody tr:last-child {
	border-bottom: none;
}

.rg-fin-table tbody tr:hover {
	background: var(--rg-color-bg-gray);
}

.rg-fin-table tbody td {
	padding: var(--rg-space-3) var(--rg-space-4);
	vertical-align: middle;
	color: var(--rg-color-text);
}

/* IP em monospace */
.rg-fin-table__ip {
	font-family: 'Courier New', monospace;
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-secondary);
}

/* Pill de status */
.rg-fin-pill {
	display: inline-flex;
	align-items: center;
	padding: 2px var(--rg-space-2);
	border-radius: var(--rg-radius-full);
	font-size: var(--rg-text-xs);
	font-weight: var(--rg-font-weight-medium);
}

.rg-fin-pill--ativo {
	background: rgba(0, 183, 7, 0.1);
	color: var(--rg-color-success);
}

.rg-fin-pill--arquivado {
	background: var(--rg-color-bg-gray);
	color: var(--rg-color-text-muted);
}

.rg-fin-pill--found {
	background: rgba(0, 183, 7, 0.1);
	color: var(--rg-color-success);
}

.rg-fin-pill--not-found {
	background: rgba(211, 47, 47, 0.1);
	color: var(--rg-color-error);
}

.rg-fin-pill--download {
	background: rgba(0, 5, 81, 0.08);
	color: var(--rg-color-primary);
}

.rg-fin-pill--slot-a {
	background: rgba(0, 5, 81, 0.1);
	color: var(--rg-color-primary);
}

.rg-fin-pill--slot-b {
	background: rgba(251, 197, 0, 0.2);
	color: #7a5f00;
}

/* Ícone de arquivo na tabela */
.rg-fin-file-cell {
	display: flex;
	align-items: center;
	gap: var(--rg-space-2);
}

.rg-fin-file-cell__icon {
	width: 32px;
	height: 32px;
	background: rgba(0, 5, 81, 0.06);
	border-radius: var(--rg-radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.rg-fin-file-cell__icon svg {
	width: 16px;
	height: 16px;
	color: var(--rg-color-primary);
}

.rg-fin-file-cell__name {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text);
	font-weight: var(--rg-font-weight-medium);
}

/* Imóvel badge */
.rg-fin-imovel-badge {
	display: inline-block;
	background: rgba(0, 5, 81, 0.06);
	color: var(--rg-color-primary);
	border-radius: var(--rg-radius-full);
	padding: 2px var(--rg-space-2);
	font-size: var(--rg-text-xs);
	font-family: 'Courier New', monospace;
}

/* Botão de ações */
.rg-fin-actions-btn {
	background: none !important; /* Kit green override */
	border: none !important;
	cursor: pointer;
	padding: var(--rg-space-1) !important;
	border-radius: var(--rg-radius-sm) !important;
	color: var(--rg-color-text-muted) !important;
	font-size: var(--rg-text-md);
	line-height: 1;
}

.rg-fin-actions-btn:hover {
	background: var(--rg-color-bg-gray) !important;
	color: var(--rg-color-text) !important;
}

/* User-agent expandível */
.rg-fin-ua-toggle {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted) !important; /* Kit green override */
	cursor: pointer;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	border-radius: 0 !important;
	text-decoration: underline;
}

.rg-fin-ua-row {
	display: none;
}

.rg-fin-ua-row.is-open {
	display: table-row;
}

.rg-fin-ua-row td {
	background: var(--rg-color-bg-gray);
	font-size: var(--rg-text-xs);
	font-family: 'Courier New', monospace;
	color: var(--rg-color-text-secondary);
	word-break: break-all;
}

/* Paginação de datas */
.rg-fin-date-nav {
	display: flex;
	align-items: center;
	gap: var(--rg-space-3);
}

.rg-fin-date-nav__btn {
	background: none !important; /* Kit green override */
	border: 1px solid var(--rg-color-border) !important;
	border-radius: var(--rg-radius-sm) !important;
	padding: var(--rg-space-1) var(--rg-space-3) !important;
	cursor: pointer;
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text) !important;
}

.rg-fin-date-nav__btn:hover {
	background: var(--rg-color-bg-gray) !important;
}

.rg-fin-date-nav input[type="date"] {
	border: 1px solid var(--rg-color-border);
	border-radius: var(--rg-radius-sm);
	padding: var(--rg-space-1) var(--rg-space-3);
	font-size: var(--rg-text-sm);
	font-family: var(--rg-font-body);
}

/* Botão exportar log */
.rg-fin-export-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--rg-space-2);
	padding: var(--rg-space-2) var(--rg-space-4) !important; /* Kit padding:0 override */
	background: none !important; /* Kit green override */
	border: 1px solid var(--rg-color-border) !important;
	border-radius: var(--rg-radius-sm) !important;
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text) !important;
	cursor: pointer;
	text-decoration: none !important;
	transition: background 0.15s ease;
}

.rg-fin-export-btn:hover {
	background: var(--rg-color-bg-gray) !important;
}

.rg-fin-export-btn svg {
	width: 16px;
	height: 16px;
}


/* =============================================================================
   ESTADO VAZIO (Figma 3:1517)
   ============================================================================= */

.rg-fin-empty {
	text-align: center;
	padding: var(--rg-space-16) var(--rg-space-8);
}

.rg-fin-empty__icon {
	font-size: 48px;
	margin-bottom: var(--rg-space-4);
	opacity: 0.4;
}

.rg-fin-empty__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-lg);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-2);
}

.rg-fin-empty__desc {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-muted);
	margin: 0 0 var(--rg-space-6);
}

.rg-fin-empty__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--rg-space-3);
	flex-wrap: wrap;
}

/* Stats cards — linhas inferiores do estado vazio */
.rg-fin-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--rg-space-4);
	margin-top: var(--rg-space-6);
}

@media (max-width: 640px) {
	.rg-fin-stats {
		grid-template-columns: 1fr;
	}
}

.rg-fin-stat {
	background: #fff;
	border-radius: var(--rg-radius);
	padding: var(--rg-space-5);
	text-align: center;
	box-shadow: var(--rg-shadow);
}

.rg-fin-stat__value {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-xl);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-primary);
	margin-bottom: var(--rg-space-1);
}

.rg-fin-stat__label {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
}


/* =============================================================================
   ERRO DE LOG (Figma 3:1375)
   ============================================================================= */

.rg-fin-warning {
	background: rgba(251, 197, 0, 0.1);
	border: 1px solid var(--rg-color-accent);
	border-radius: var(--rg-radius);
	padding: var(--rg-space-4) var(--rg-space-5);
	display: flex;
	align-items: flex-start;
	gap: var(--rg-space-3);
	margin-bottom: var(--rg-space-6);
}

.rg-fin-warning__icon {
	font-size: 20px;
	flex-shrink: 0;
}

.rg-fin-warning__title {
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-1);
	font-size: var(--rg-text-sm);
}

.rg-fin-warning__desc {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin: 0;
}

.rg-fin-info-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--rg-space-4);
}

@media (max-width: 640px) {
	.rg-fin-info-cards {
		grid-template-columns: 1fr;
	}
}

.rg-fin-info-card {
	background: #fff;
	border-radius: var(--rg-radius);
	padding: var(--rg-space-5);
	box-shadow: var(--rg-shadow);
}

.rg-fin-info-card__icon {
	font-size: 24px;
	margin-bottom: var(--rg-space-2);
}

.rg-fin-info-card__title {
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-1);
}

.rg-fin-info-card__value {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
}


/* =============================================================================
   IMPORTAÇÃO CONCLUÍDA (Figma 3:1901)
   ============================================================================= */

.rg-fin-success {
	text-align: center;
	padding: var(--rg-space-8);
}

.rg-fin-success__icon {
	width: 72px;
	height: 72px;
	background: var(--rg-color-success);
	border-radius: var(--rg-radius-full);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--rg-space-5);
}

.rg-fin-success__icon svg {
	width: 36px;
	height: 36px;
	fill: #fff;
}

.rg-fin-success__title {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-xl);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-text);
	margin: 0 0 var(--rg-space-2);
}

.rg-fin-success__badge {
	display: inline-flex;
	align-items: center;
	gap: var(--rg-space-2);
	background: rgba(0, 183, 7, 0.1);
	color: var(--rg-color-success);
	border-radius: var(--rg-radius-full);
	padding: var(--rg-space-1) var(--rg-space-4);
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-medium);
	margin-bottom: var(--rg-space-6);
}

.rg-fin-success__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--rg-space-3);
	flex-wrap: wrap;
	margin-top: var(--rg-space-6);
}

.rg-fin-success__stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--rg-space-4);
	margin-top: var(--rg-space-6);
	text-align: left;
}

@media (max-width: 640px) {
	.rg-fin-success__stats {
		grid-template-columns: 1fr;
	}
}

.rg-fin-success__stat-label {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin-bottom: 2px;
}

.rg-fin-success__stat-value {
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-lg);
	font-weight: var(--rg-font-weight-bold);
	color: var(--rg-color-text);
}


/* =============================================================================
   NOTA LEGAL LGPD
   ============================================================================= */

.rg-fin-legal {
	border: 1px solid var(--rg-color-accent);
	border-radius: var(--rg-radius);
	padding: var(--rg-space-4) var(--rg-space-5);
	background: rgba(251, 197, 0, 0.06);
	margin-top: var(--rg-space-6);
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-secondary);
}

.rg-fin-legal__title {
	font-weight: var(--rg-font-weight-medium);
	color: var(--rg-color-text);
	margin-bottom: var(--rg-space-1);
}


/* =============================================================================
   BOTÕES DE AÇÃO FINANCEIRO
   ============================================================================= */

.rg-fin-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--rg-space-2);
	padding: var(--rg-space-2) var(--rg-space-5) !important; /* Kit padding:0 override */
	border-radius: var(--rg-radius) !important; /* Kit border-radius:26.5px override */
	font-family: var(--rg-font-heading);
	font-size: var(--rg-text-sm);
	font-weight: var(--rg-font-weight-bold);
	cursor: pointer;
	text-decoration: none !important;
	border: none !important;
	transition: opacity 0.15s ease;
}

.rg-fin-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rg-fin-btn--primary {
	background: var(--rg-color-primary) !important; /* Kit green override */
	color: #fff !important;
}

.rg-fin-btn--outline {
	background: transparent !important;
	border: 2px solid var(--rg-color-primary) !important;
	color: var(--rg-color-primary) !important;
}

.rg-fin-btn--success {
	background: var(--rg-color-success) !important;
	color: #fff !important;
}

.rg-fin-btn:hover:not(:disabled) {
	opacity: 0.88;
}

.rg-fin-btn svg {
	width: 16px;
	height: 16px;
}


/* =============================================================================
   OVERFLOW + RESPONSIVIDADE DE TABELA
   ============================================================================= */

.rg-fin-table-wrap .rg-fin-table-scroll {
	overflow-x: auto;
}

@media (max-width: 900px) {
	.rg-fin-table thead th:nth-child(n+5) {
		display: none;
	}
	.rg-fin-table tbody td:nth-child(n+5) {
		display: none;
	}
}


/* =============================================================================
   IMPORTAÇÃO FTP — STATUS CARDS
   ============================================================================= */

.rg-fin-import-status {
	margin-bottom: var(--rg-space-6);
}

.rg-fin-import-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--rg-space-4);
	margin-bottom: var(--rg-space-4);
}

.rg-fin-import-card {
	background: #fff;
	border: 1px solid var(--rg-color-border);
	border-radius: var(--rg-radius-md);
	padding: var(--rg-space-4);
	border-left: 4px solid var(--rg-color-border);
}

.rg-fin-import-card--success { border-left-color: var(--rg-color-success); }
.rg-fin-import-card--error   { border-left-color: #dc2626; }
.rg-fin-import-card--neutral { border-left-color: var(--rg-color-border); }

.rg-fin-import-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--rg-space-3);
}

.rg-fin-import-card__label {
	font-weight: 600;
	font-size: var(--rg-text-sm);
}

.rg-fin-import-card__badge {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 500;
}

.rg-fin-import-card__badge--ok    { background: #dcfce7; color: #166534; }
.rg-fin-import-card__badge--stale { background: #fef3c7; color: #92400e; }
.rg-fin-import-card__badge--never { background: #f1f5f9; color: #64748b; }

.rg-fin-import-card__dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 12px;
	font-size: var(--rg-text-xs);
	margin: 0;
}

.rg-fin-import-card__dl dt { color: var(--rg-color-text-muted); }
.rg-fin-import-card__dl dd { margin: 0; word-break: break-all; }

.rg-fin-import-card__status--success { color: var(--rg-color-success); font-weight: 600; }
.rg-fin-import-card__status--error   { color: #dc2626; font-weight: 600; }

.rg-fin-import-actions {
	display: flex;
	align-items: center;
	gap: var(--rg-space-3);
	margin-bottom: var(--rg-space-4);
}

.rg-fin-import-run-status {
	font-size: var(--rg-text-sm);
	color: var(--rg-color-text-muted);
}

.rg-fin-import-cron {
	background: #f8fafc;
	border: 1px solid var(--rg-color-border);
	border-radius: var(--rg-radius-md);
	padding: var(--rg-space-4);
}

.rg-fin-import-cron__title {
	font-size: var(--rg-text-xs);
	font-weight: 600;
	color: var(--rg-color-text-muted);
	margin: 0 0 var(--rg-space-2);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.rg-fin-import-cron__cmd-wrap {
	display: flex;
	align-items: center;
	gap: var(--rg-space-2);
	margin-bottom: var(--rg-space-2);
}

.rg-fin-import-cron__cmd {
	flex: 1;
	background: #1e293b;
	color: #e2e8f0;
	padding: var(--rg-space-2) var(--rg-space-3);
	border-radius: var(--rg-radius-sm);
	font-size: 11px;
	overflow-x: auto;
	white-space: nowrap;
	display: block;
}

.rg-fin-btn--copy {
	background: transparent !important;
	border: 1px solid var(--rg-color-border) !important;
	color: var(--rg-color-text-muted) !important;
	font-size: var(--rg-text-xs) !important;
	padding: 4px 10px !important;
	white-space: nowrap;
}

.rg-fin-import-cron__hint {
	font-size: var(--rg-text-xs);
	color: var(--rg-color-text-muted);
	margin: 0;
}
