/*
 * TOP1 Service — Finance workspace.
 * UI-only layer: all calculations, forms, permissions and write paths remain intact.
 */

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell {
	--top1-finance-ink: #0f172a;
	--top1-finance-muted: #64748b;
	--top1-finance-line: #dbe4ef;
	--top1-finance-line-strong: #c8d5e3;
	--top1-finance-soft: #f5f8fc;
	--top1-finance-red: #e11d2e;
	--top1-finance-red-dark: #bd1022;
	--top1-finance-green: #059669;
	--top1-finance-blue: #2563eb;
	display: grid;
	gap: 16px;
	width: 100%;
	min-width: 0;
	color: var(--top1-finance-ink);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell,
.top1-app-shell[data-top1-section="finance"] .top1-finance-shell * {
	box-sizing: border-box;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	min-height: 112px;
	padding: 20px 22px;
	overflow: hidden;
	border: 1px solid rgba(203, 213, 225, .84);
	border-radius: 20px;
	background:
		radial-gradient(circle at 90% 0%, rgba(5, 150, 105, .11), transparent 28%),
		radial-gradient(circle at 68% 115%, rgba(225, 29, 46, .075), transparent 32%),
		linear-gradient(135deg, #ffffff 0%, #f7fbff 62%, #f5fffb 100%);
	box-shadow: 0 16px 44px rgba(15, 23, 42, .08);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro::after {
	content: "";
	position: absolute;
	right: 84px;
	bottom: -54px;
	width: 220px;
	height: 94px;
	border: 18px solid rgba(5, 150, 105, .035);
	border-radius: 50%;
	pointer-events: none;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-mark {
	position: relative;
	z-index: 1;
	display: grid;
	width: 58px;
	height: 58px;
	place-items: center;
	border: 1px solid rgba(5, 150, 105, .2);
	border-radius: 17px;
	background: linear-gradient(145deg, #fff 0%, #ecfdf5 100%);
	color: #047857;
	box-shadow: 0 12px 28px rgba(5, 150, 105, .13);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-mark svg {
	width: 29px;
	height: 29px;
	fill: currentColor;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-copy {
	position: relative;
	z-index: 1;
	min-width: 0;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-copy > span {
	display: block;
	margin-bottom: 4px;
	color: #047857;
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .11em;
	line-height: 1.2;
	text-transform: uppercase;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro h1 {
	margin: 0;
	color: var(--top1-finance-ink);
	font-size: clamp(25px, 2.15vw, 35px);
	font-weight: 950;
	letter-spacing: -.04em;
	line-height: 1.04;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro p {
	max-width: 820px;
	margin: 7px 0 0;
	color: #526277;
	font-size: 13px;
	font-weight: 650;
	line-height: 1.45;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-period {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 3px;
	min-width: 170px;
	padding: 12px 14px;
	border: 1px solid rgba(203, 213, 225, .8);
	border-radius: 14px;
	background: rgba(255, 255, 255, .86);
	box-shadow: 0 8px 22px rgba(15, 23, 42, .055);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-period span {
	color: var(--top1-finance-muted);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-period strong {
	color: var(--top1-finance-ink);
	font-size: 16px;
	font-weight: 950;
	letter-spacing: -.015em;
}

.top1-app-shell[data-top1-section="finance"] :is(#top1-finance-overview, #top1-finance-latest-entries, #top1-finance-orders-payments, #top1-finance-operating-expenses, #top1-finance-expenses) {
	scroll-margin-top: 18px;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter {
	display: flex !important;
	align-items: end !important;
	gap: 10px !important;
	margin: 0 !important;
	padding: 13px 15px !important;
	border: 1px solid var(--top1-finance-line) !important;
	border-radius: 15px !important;
	background: #fff !important;
	box-shadow: 0 9px 24px rgba(15, 23, 42, .055) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter::before {
	content: "Период отчёта";
	display: grid;
	min-height: 42px;
	align-items: center;
	padding-right: 14px;
	border-right: 1px solid var(--top1-finance-line);
	color: #334155;
	font-size: 12px;
	font-weight: 900;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter .top1-finance-month-filter-grid {
	display: grid !important;
	grid-template-columns: 170px !important;
	flex: 0 0 auto !important;
	gap: 8px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter .top1-client-form-actions {
	margin: 0 !important;
	padding: 0 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
	width: 100% !important;
	min-width: 0 !important;
	min-height: 42px !important;
	padding: 9px 11px !important;
	border: 1px solid var(--top1-finance-line-strong) !important;
	border-radius: 11px !important;
	background: #fff !important;
	color: var(--top1-finance-ink) !important;
	font: inherit !important;
	font-size: 12px !important;
	font-weight: 650 !important;
	line-height: 1.35 !important;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025) !important;
	transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell textarea {
	min-height: 76px !important;
	resize: vertical !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
	border-color: #4f7ee8 !important;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, .15) !important;
	outline: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-client-form-field, .top1-operating-template-grid label) {
	display: grid !important;
	min-width: 0 !important;
	gap: 6px !important;
	color: #3e4b5f !important;
	font-size: 10px !important;
	font-weight: 850 !important;
	line-height: 1.2 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-app-button, .top1-secondary-button, .top1-operating-template-trigger) {
	display: inline-flex !important;
	min-height: 40px !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 7px !important;
	padding: 9px 14px !important;
	border-radius: 11px !important;
	font-size: 11px !important;
	font-weight: 850 !important;
	line-height: 1.1 !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	transition: transform .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease, color .16s ease !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-app-button {
	border: 1px solid var(--top1-finance-red) !important;
	background: linear-gradient(135deg, #ef233c 0%, #cf1026 100%) !important;
	color: #fff !important;
	box-shadow: 0 9px 18px rgba(207, 16, 38, .19) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-secondary-button, .top1-operating-template-trigger) {
	border: 1px solid var(--top1-finance-line-strong) !important;
	background: #fff !important;
	color: #253047 !important;
	box-shadow: 0 4px 10px rgba(15, 23, 42, .035) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-app-button, .top1-secondary-button, .top1-operating-template-trigger):hover,
.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-app-button, .top1-secondary-button, .top1-operating-template-trigger):focus-visible {
	outline: none !important;
	transform: translateY(-1px) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-app-button:hover,
.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-app-button:focus-visible {
	background: linear-gradient(135deg, #dc172f 0%, #b70d20 100%) !important;
	box-shadow: 0 12px 24px rgba(190, 15, 34, .25) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-center {
	display: grid !important;
	grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr) !important;
	gap: 15px !important;
	margin: 0 !important;
	padding: 18px !important;
	border: 1px solid var(--top1-finance-line) !important;
	border-radius: 20px !important;
	background:
		radial-gradient(circle at 96% 0, rgba(37, 99, 235, .07), transparent 28%),
		linear-gradient(145deg, #fff 0%, #f8fbff 100%) !important;
	color: var(--top1-finance-ink) !important;
	box-shadow: 0 16px 44px rgba(15, 23, 42, .075) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-hero {
	display: grid !important;
	align-content: start !important;
	gap: 8px !important;
	max-width: none !important;
	min-width: 0 !important;
	padding: 2px 6px 2px 2px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-kicker,
.top1-app-shell[data-top1-section="finance"] .top1-finance-next-title {
	color: #047857 !important;
	font-size: 10px !important;
	font-weight: 900 !important;
	letter-spacing: .08em !important;
	text-transform: uppercase !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-hero h2 {
	margin: 0 !important;
	color: var(--top1-finance-ink) !important;
	font-size: 20px !important;
	font-weight: 950 !important;
	letter-spacing: -.02em !important;
	line-height: 1.16 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-hero p {
	max-width: 62ch !important;
	margin: 0 !important;
	color: #526277 !important;
	font-size: 12px !important;
	font-weight: 650 !important;
	line-height: 1.48 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-actions {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	align-items: center !important;
	margin-top: 4px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-chip {
	display: inline-flex !important;
	min-height: 30px !important;
	align-items: center !important;
	padding: 6px 9px !important;
	border: 1px solid #d5e1ec !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: #526277 !important;
	font-size: 10px !important;
	font-weight: 800 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-chip:last-child {
	display: inline-flex !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-cards {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 9px !important;
	margin: 0 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card {
	position: relative !important;
	display: grid !important;
	gap: 5px !important;
	min-height: 72px !important;
	align-content: center !important;
	padding: 11px 12px 11px 15px !important;
	overflow: hidden !important;
	border: 1px solid var(--top1-finance-line) !important;
	border-radius: 13px !important;
	background: #fff !important;
	box-shadow: 0 6px 16px rgba(15, 23, 42, .045) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card::before {
	content: "" !important;
	position: absolute !important;
	top: 11px !important;
	bottom: 11px !important;
	left: 0 !important;
	width: 3px !important;
	border-radius: 0 3px 3px 0 !important;
	background: var(--top1-finance-blue) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card.is-danger::before { background: #dc2626 !important; }
.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card.is-warning::before { background: #d97706 !important; }
.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card.is-success::before { background: #059669 !important; }

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card span {
	display: block !important;
	overflow: visible !important;
	color: var(--top1-finance-muted) !important;
	font-size: 10px !important;
	font-weight: 800 !important;
	line-height: 1.25 !important;
	text-overflow: clip !important;
	white-space: normal !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-command-card strong {
	display: block !important;
	margin: 0 !important;
	overflow: visible !important;
	color: var(--top1-finance-ink) !important;
	font-size: 17px !important;
	font-weight: 950 !important;
	letter-spacing: -.02em !important;
	line-height: 1.1 !important;
	text-overflow: clip !important;
	white-space: normal !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-next-actions {
	grid-column: 1 / -1 !important;
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 7px !important;
	align-items: center !important;
	margin: 0 !important;
	padding-top: 12px !important;
	border-top: 1px solid var(--top1-finance-line) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-next-actions span {
	min-height: 28px !important;
	padding: 5px 9px !important;
	border: 1px solid #d8e3ed !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: #526277 !important;
	font-size: 10px !important;
	font-weight: 750 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 12px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card {
	position: relative !important;
	display: grid !important;
	gap: 5px !important;
	min-height: 96px !important;
	align-content: center !important;
	padding: 16px 18px 15px 20px !important;
	overflow: hidden !important;
	border: 1px solid rgba(203, 213, 225, .82) !important;
	border-radius: 16px !important;
	background: linear-gradient(145deg, #fff 0%, #f8fafc 100%) !important;
	box-shadow: 0 11px 28px rgba(15, 23, 42, .065) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card::before {
	content: "" !important;
	display: block !important;
	position: absolute !important;
	top: 14px !important;
	bottom: 14px !important;
	left: 0 !important;
	width: 4px !important;
	border-radius: 0 4px 4px 0 !important;
	background: #2563eb !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card:nth-child(2)::before { background: #dc2626 !important; }
.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card:nth-child(3)::before { background: #f59e0b !important; }
.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card:nth-child(4)::before { background: #059669 !important; }

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-label {
	color: #607086 !important;
	font-size: 11px !important;
	font-weight: 800 !important;
	line-height: 1.25 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-value {
	margin: 0 !important;
	color: var(--top1-finance-ink) !important;
	font-size: clamp(23px, 2vw, 29px) !important;
	font-weight: 950 !important;
	letter-spacing: -.035em !important;
	line-height: 1 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-workspace {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 360px) !important;
	gap: 14px !important;
	min-width: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-main {
	display: grid !important;
	gap: 14px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-content-card, .top1-finance-card, .top1-finance-bottom-card, .top1-finance-inspector) {
	min-width: 0 !important;
	padding: 17px !important;
	border: 1px solid rgba(203, 213, 225, .84) !important;
	border-radius: 18px !important;
	background: rgba(255, 255, 255, .97) !important;
	box-shadow: 0 13px 34px rgba(15, 23, 42, .065) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-content-card, .top1-finance-card, .top1-finance-bottom-card, .top1-finance-inspector) > .top1-card-header {
	display: flex !important;
	gap: 12px !important;
	align-items: center !important;
	justify-content: space-between !important;
	margin: 0 0 13px !important;
	padding: 0 0 12px !important;
	border-bottom: 1px solid #e5ebf2 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-card-header h2 {
	margin: 0 !important;
	color: var(--top1-finance-ink) !important;
	font-size: 17px !important;
	font-weight: 950 !important;
	letter-spacing: -.018em !important;
	line-height: 1.2 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-finance-mini-header {
	margin-top: 15px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-order-payment-form, .top1-finance-operating-form, .top1-finance-expense-form) {
	display: grid !important;
	gap: 12px !important;
	margin: 0 0 14px !important;
	padding: 14px !important;
	border: 1px solid var(--top1-finance-line) !important;
	border-radius: 14px !important;
	background: #f8fafc !important;
	box-shadow: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-order-payment-form-grid, .top1-finance-operating-form-grid, .top1-finance-expense-form-grid, .top1-operating-template-grid) {
	display: grid !important;
	gap: 10px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-order-payment-form-grid {
	grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .6fr) minmax(170px, .75fr) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-finance-operating-form-grid {
	grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .65fr) minmax(140px, .65fr) minmax(220px, 1.15fr) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-finance-expense-form-grid {
	grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-client-form-field-wide {
	grid-column: span 2 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-client-form-actions {
	display: flex !important;
	justify-content: flex-end !important;
	margin: 0 !important;
	padding: 0 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-ledger,
.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-table-placeholder {
	overflow-x: auto !important;
	border: 1px solid var(--top1-finance-line) !important;
	border-radius: 13px !important;
	background: #fff !important;
	box-shadow: none !important;
	scrollbar-width: thin !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-finance-row, .top1-table-row) {
	gap: 11px !important;
	min-width: 720px !important;
	padding: 11px 12px !important;
	border: 0 !important;
	border-bottom: 1px solid #e7edf4 !important;
	background: #fff !important;
	color: #334155 !important;
	font-size: 11px !important;
	font-weight: 650 !important;
	line-height: 1.35 !important;
	transition: background-color .14s ease, box-shadow .14s ease !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-finance-row, .top1-table-row):last-child {
	border-bottom: 0 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-finance-row, .top1-table-row):not(.top1-finance-row-head):not(.top1-table-row-head):hover {
	background: #f8fbff !important;
	box-shadow: inset 3px 0 0 #4f7ee8 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-finance-row-head, .top1-table-row-head) {
	padding-block: 10px !important;
	border-bottom-color: #d6e0eb !important;
	background: #eef3f8 !important;
	color: #526277 !important;
	font-size: 9px !important;
	font-weight: 900 !important;
	letter-spacing: .035em !important;
	text-transform: uppercase !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-status {
	display: inline-flex !important;
	min-height: 25px !important;
	align-items: center !important;
	gap: 5px !important;
	width: fit-content !important;
	padding: 5px 8px !important;
	border: 1px solid #eedba5 !important;
	border-radius: 999px !important;
	background: #fff8e7 !important;
	color: #946100 !important;
	font-size: 9px !important;
	font-weight: 850 !important;
	line-height: 1.1 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-status.is-active {
	border-color: #bdebd8 !important;
	background: #ebfaf4 !important;
	color: #047857 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-popover {
	position: relative !important;
	z-index: 20 !important;
	width: fit-content !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-popover[open] {
	z-index: 100 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-trigger {
	list-style: none !important;
	cursor: pointer !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-trigger::-webkit-details-marker {
	display: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-panel {
	position: absolute !important;
	top: calc(100% + 10px) !important;
	right: 0 !important;
	z-index: 1500 !important;
	width: 440px !important;
	max-width: calc(100vw - 48px) !important;
	padding: 16px !important;
	border: 1px solid #d5e0eb !important;
	border-radius: 17px !important;
	background: #fff !important;
	box-shadow: 0 24px 60px rgba(15, 23, 42, .2) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-popover:not([open]) > .top1-operating-template-panel {
	display: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-head {
	display: grid !important;
	gap: 3px !important;
	margin-bottom: 12px !important;
	padding-bottom: 11px !important;
	border-bottom: 1px solid #e5ebf2 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-head strong {
	color: var(--top1-finance-ink) !important;
	font-size: 15px !important;
	font-weight: 950 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-head span {
	color: var(--top1-finance-muted) !important;
	font-size: 10px !important;
	font-weight: 650 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-form {
	display: grid !important;
	gap: 11px !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-operating-template-remove-form {
	margin-top: 10px !important;
	padding-top: 10px !important;
	border-top: 1px solid #e8edf3 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-inline-notice {
	margin: 0 !important;
	padding: 11px 13px !important;
	border-radius: 12px !important;
	font-size: 11px !important;
	font-weight: 750 !important;
}

@media (max-width: 1220px) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-command-center {
		grid-template-columns: 1fr !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-workspace {
		grid-template-columns: minmax(0, 1fr) minmax(290px, 330px) !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-finance-operating-form-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 940px) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-intro {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-period {
		grid-column: 2;
		width: fit-content;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-workspace {
		grid-template-columns: 1fr !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-inspector {
		position: static !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-order-payment-form-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 680px) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell {
		gap: 12px;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-intro {
		grid-template-columns: 1fr;
		gap: 11px;
		padding: 17px;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-mark {
		width: 48px;
		height: 48px;
		border-radius: 14px;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-intro-period {
		grid-column: auto;
		width: 100%;
		min-width: 0;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter {
		align-items: stretch !important;
		flex-direction: column !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter::before {
		min-height: auto;
		padding: 0 0 8px;
		border-right: 0;
		border-bottom: 1px solid var(--top1-finance-line);
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter .top1-finance-month-filter-grid {
		grid-template-columns: 1fr !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-filter .top1-secondary-button {
		width: 100%;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-command-cards,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-grid,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-order-payment-form-grid, .top1-finance-operating-form-grid, .top1-finance-expense-form-grid, .top1-operating-template-grid) {
		grid-template-columns: 1fr !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card {
		min-height: 82px !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-client-form-field-wide {
		grid-column: auto !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-content-card, .top1-finance-card, .top1-finance-bottom-card, .top1-finance-inspector) {
		padding: 14px !important;
		border-radius: 16px !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell .top1-client-form-actions {
		align-items: stretch !important;
		flex-direction: column !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell :is(.top1-app-button, .top1-secondary-button) {
		white-space: normal !important;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-operating-template-panel {
		position: fixed !important;
		top: 50% !important;
		right: 14px !important;
		left: 14px !important;
		width: auto !important;
		max-width: none !important;
		max-height: calc(100dvh - 28px) !important;
		overflow-y: auto !important;
		transform: translateY(-50%) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell *,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell *::before,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-shell *::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}

/* Finance workflow clarity: month controls, canonical totals and safe payments. */
.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	flex-wrap: wrap;
	padding: 4px;
	border: 1px solid var(--top1-finance-line);
	border-radius: 13px;
	background: #f8fafc;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps a {
	display: inline-flex;
	min-height: 34px;
	align-items: center;
	justify-content: center;
	padding: 7px 11px;
	border-radius: 9px;
	color: #475569;
	font-size: 12px;
	font-weight: 800;
	text-decoration: none;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps a:hover,
.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps a:focus-visible {
	background: #fff;
	color: var(--top1-finance-blue);
	box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-note {
	margin-top: 6px;
	color: #64748b;
	font-size: 11px;
	font-weight: 650;
	line-height: 1.35;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-income::before {
	background: #2563eb !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-expense::before,
.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-negative::before {
	background: #dc2626 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-debt::before {
	background: #d97706 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-positive::before {
	background: #059669 !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-negative {
	background: linear-gradient(145deg, #fff 0%, #fff5f5 100%) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-summary-card.is-positive {
	background: linear-gradient(145deg, #fff 0%, #f1fcf7 100%) !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	overflow: hidden;
	border: 1px solid var(--top1-finance-line);
	border-radius: 16px;
	background: var(--top1-finance-line);
	box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown > div {
	display: grid;
	gap: 5px;
	min-width: 0;
	padding: 13px 16px;
	background: rgba(255, 255, 255, .96);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown span {
	color: #64748b;
	font-size: 11px;
	font-weight: 750;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown strong {
	overflow: hidden;
	color: #172033;
	font-size: 15px;
	font-weight: 900;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-section-caption {
	margin: 4px 0 0;
	color: #64748b;
	font-size: 11px;
	font-weight: 650;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-debt-badge {
	display: inline-flex;
	min-height: 34px;
	align-items: center;
	padding: 7px 11px;
	border: 1px solid #f5d28d;
	border-radius: 999px;
	background: #fff9e9;
	color: #92400e;
	font-size: 11px;
	font-weight: 850;
	white-space: nowrap;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-top: 10px;
	padding: 10px;
	border: 1px solid #cfe0f5;
	border-radius: 14px;
	background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview[hidden] {
	display: none !important;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview > div {
	display: grid;
	gap: 3px;
	min-width: 0;
	padding: 5px 7px;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview span {
	color: #64748b;
	font-size: 10px;
	font-weight: 750;
	text-transform: uppercase;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview strong {
	overflow: hidden;
	color: #172033;
	font-size: 12px;
	font-weight: 850;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-money-cell {
	font-variant-numeric: tabular-nums;
	font-weight: 850;
	white-space: nowrap;
}

.top1-app-shell[data-top1-section="finance"] .top1-finance-money-cell.is-debt {
	color: #b45309;
}

@media (max-width: 940px) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: 100%;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-month-steps a {
		padding-inline: 7px;
		font-size: 10px;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-breakdown,
	.top1-app-shell[data-top1-section="finance"] .top1-finance-payment-preview {
		grid-template-columns: 1fr;
	}

	.top1-app-shell[data-top1-section="finance"] .top1-finance-debt-badge {
		width: 100%;
		justify-content: center;
		white-space: normal;
	}
}
