/* Tooloos Advanced Invoice Generator */
.tls-invoice-app,
.tls-invoice-app * {
	box-sizing: border-box;
}

.tls-invoice-app {
	--tls-primary: #2563eb;
	--tls-primary-dark: #1d4ed8;
	--tls-primary-soft: #eff6ff;
	--tls-dark: #101828;
	--tls-text: #475467;
	--tls-muted: #667085;
	--tls-border: #e4e7ec;
	--tls-bg: #f8fafc;
	--tls-white: #ffffff;
	width: 100%;
	padding: 72px 22px 96px;
	background:
		radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .08), transparent 28%),
		#f8fafc;
	color: var(--tls-dark);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	-webkit-font-smoothing: auto;
	text-rendering: auto;
}

.tls-invoice-shell {
	width: min(100%, 1480px);
	margin: 0 auto;
}

.tls-invoice-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 30px;
	margin-bottom: 36px;
}

.tls-invoice-kicker {
	display: inline-block;
	margin-bottom: 10px;
	color: var(--tls-primary);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.tls-invoice-header h1 {
	margin: 0;
	color: var(--tls-dark);
	font-size: clamp(34px, 4.3vw, 52px);
	font-weight: 700;
	letter-spacing: -.04em;
	line-height: 1.08;
}

.tls-invoice-header p {
	max-width: 760px;
	margin: 14px 0 0;
	color: var(--tls-text);
	font-size: 15px;
	line-height: 1.65;
}

.tls-invoice-privacy {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	padding: 10px 13px;
	border: 1px solid #d1fadf;
	border-radius: 999px;
	background: #ecfdf3;
	color: #027a48;
	font-size: 11px;
	font-weight: 600;
}

.tls-invoice-privacy svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-invoice-workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(520px, .9fr);
	gap: 24px;
	align-items: start;
}

.tls-invoice-editor {
	display: grid;
	gap: 15px;
}

.tls-panel {
	padding: 23px;
	border: 1px solid var(--tls-border);
	border-radius: 17px;
	background: #fff;
	box-shadow: 0 8px 26px rgba(16, 24, 40, .035);
}

.tls-panel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.tls-panel-heading > div > span {
	display: block;
	margin-bottom: 4px;
	color: var(--tls-primary);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.tls-panel-heading h2 {
	margin: 0;
	color: var(--tls-dark);
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -.015em;
	line-height: 1.35;
}

.tls-form-grid {
	display: grid;
	gap: 15px;
}

.tls-form-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tls-form-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tls-field-full {
	grid-column: 1 / -1;
}

.tls-field {
	display: grid;
	gap: 7px;
	min-width: 0;
}

.tls-field > span {
	color: #344054;
	font-size: 11px;
	font-weight: 600;
}

.tls-field input,
.tls-field select,
.tls-field textarea {
	width: 100%;
	min-width: 0;
	border: 1px solid #d0d5dd !important;
	border-radius: 9px !important;
	outline: none !important;
	background: #fff !important;
	color: #101828 !important;
	font-family: inherit;
	font-size: 13px !important;
	font-weight: 400 !important;
	box-shadow: none !important;
}

.tls-field input,
.tls-field select {
	height: 44px;
	padding: 0 12px !important;
}

.tls-field textarea {
	min-height: 82px;
	padding: 11px 12px !important;
	line-height: 1.5;
	resize: vertical;
}

.tls-field input:focus,
.tls-field select:focus,
.tls-field textarea:focus {
	border-color: #84adff !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .1) !important;
}

.tls-tax-options,
.tls-adjustments {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.tls-tax-options {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tls-smart-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 15px;
	padding: 12px 13px;
	border: 1px solid #dbeafe;
	border-radius: 10px;
	background: #f5f9ff;
}

.tls-smart-note svg {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	fill: none;
	stroke: var(--tls-primary);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-smart-note p {
	margin: 0;
	color: #475467;
	font-size: 11px;
	line-height: 1.55;
}

.tls-logo-upload {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 39px;
	padding: 0 12px;
	border: 1px solid #d0d5dd;
	border-radius: 9px;
	background: #fff;
	color: #344054;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}

.tls-logo-upload input {
	display: none;
}

.tls-logo-upload svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-logo-preview-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: -4px 0 17px;
	padding: 11px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #f8fafc;
}

.tls-logo-preview-row img {
	width: 56px;
	height: 56px;
	padding: 4px;
	border: 1px solid #eaecf0;
	border-radius: 9px;
	background: #fff;
	object-fit: contain;
}

.tls-logo-preview-row button {
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: #b42318 !important;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}

.tls-secondary-button,
.tls-primary-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 41px;
	padding: 0 14px !important;
	border-radius: 9px !important;
	font-family: inherit;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.tls-secondary-button {
	border: 1px solid #d0d5dd !important;
	background: #fff !important;
	color: #344054 !important;
}

.tls-secondary-button:hover,
.tls-secondary-button:focus {
	border-color: #84adff !important;
	background: #eff6ff !important;
	color: #1d4ed8 !important;
}

.tls-primary-button {
	border: 1px solid var(--tls-primary) !important;
	background: var(--tls-primary) !important;
	color: #fff !important;
}

.tls-primary-button:hover,
.tls-primary-button:focus {
	border-color: var(--tls-primary-dark) !important;
	background: var(--tls-primary-dark) !important;
	color: #fff !important;
}

.tls-danger-button {
	color: #b42318 !important;
}

.tls-secondary-button svg,
.tls-primary-button svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-items-editor {
	display: grid;
	gap: 10px;
}

.tls-item-row {
	display: grid;
	grid-template-columns: minmax(0, 2fr) 82px 120px 110px 38px;
	gap: 9px;
	align-items: end;
	padding: 12px;
	border: 1px solid #e4e7ec;
	border-radius: 11px;
	background: #f8fafc;
}

.tls-item-row .tls-field {
	gap: 5px;
}

.tls-item-row .tls-field > span {
	font-size: 9.5px;
}

.tls-item-total {
	display: flex;
	align-items: center;
	height: 44px;
	padding: 0 10px;
	border: 1px solid #e4e7ec;
	border-radius: 9px;
	background: #fff;
	color: #344054;
	font-size: 11px;
	font-weight: 600;
}

.tls-remove-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0 !important;
	border: 1px solid #fecdca !important;
	border-radius: 9px !important;
	background: #fff5f4 !important;
	color: #b42318 !important;
	cursor: pointer;
}

.tls-remove-item svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-editor-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 9px;
	padding: 18px;
	border: 1px solid var(--tls-border);
	border-radius: 15px;
	background: #fff;
}

.tls-invoice-preview-panel {
	position: sticky;
	top: 92px;
	min-width: 0;
}

.tls-preview-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	margin-bottom: 10px;
	padding: 12px 14px;
	border: 1px solid var(--tls-border);
	border-radius: 12px;
	background: #fff;
}

.tls-preview-toolbar span,
.tls-preview-toolbar strong {
	display: block;
}

.tls-preview-toolbar span {
	color: var(--tls-muted);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.tls-preview-toolbar strong {
	margin-top: 2px;
	color: var(--tls-dark);
	font-size: 12px;
	font-weight: 600;
}

.tls-preview-toolbar button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 39px;
	height: 39px;
	padding: 0 !important;
	border: 1px solid #d0d5dd !important;
	border-radius: 9px !important;
	background: #fff !important;
	color: #344054 !important;
	cursor: pointer;
}

.tls-preview-toolbar button svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tls-invoice-paper {
	--paper-primary: #2563eb;
	position: relative;
	min-height: 760px;
	overflow: hidden;
	border: 1px solid #dfe3ea;
	border-radius: 4px;
	background: #fff;
	color: #182230;
	box-shadow: 0 22px 55px rgba(16, 24, 40, .13);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.tls-paper-accent {
	height: 8px;
	background: var(--paper-primary);
}

.tls-paper-header,
.tls-paper-meta,
.tls-paper-parties,
.tls-paper-items,
.tls-paper-summary,
.tls-paper-footer-content {
	margin-right: 34px;
	margin-left: 34px;
}

.tls-paper-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 31px 0 24px;
	border-bottom: 1px solid #e4e7ec;
}

.tls-paper-brand {
	display: flex;
	align-items: center;
	gap: 13px;
	min-width: 0;
}

.tls-paper-logo-wrap {
	flex: 0 0 auto;
	width: 54px;
	height: 54px;
	padding: 5px;
	border: 1px solid #e4e7ec;
	border-radius: 10px;
	background: #fff;
}

.tls-paper-logo-wrap img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.tls-paper-brand h2 {
	margin: 0;
	color: #101828;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	word-break: break-word;
}

.tls-paper-brand p {
	margin: 4px 0 0;
	color: #667085;
	font-size: 9.5px;
	line-height: 1.5;
}

.tls-paper-title {
	flex: 0 0 auto;
	text-align: right;
}

.tls-paper-title h3 {
	margin: 0;
	color: var(--paper-primary);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.025em;
	text-transform: uppercase;
}

.tls-paper-title p {
	margin: 5px 0 0;
	color: #667085;
	font-size: 10px;
}

.tls-paper-title strong {
	color: #344054;
}

.tls-paper-meta {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	padding: 17px 0;
}

.tls-paper-meta > div {
	padding: 10px;
	border-radius: 7px;
	background: #f8fafc;
}

.tls-paper-meta span,
.tls-paper-parties > div > span,
.tls-paper-notes span,
.tls-paper-footer-content span {
	display: block;
	margin-bottom: 4px;
	color: #98a2b3;
	font-size: 7.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.tls-paper-meta strong {
	color: #344054;
	font-size: 9.5px;
	font-weight: 600;
}

.tls-paper-parties {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	padding: 2px 0 21px;
}

.tls-paper-parties > div {
	min-width: 0;
}

.tls-paper-parties strong {
	display: block;
	color: #101828;
	font-size: 11px;
	font-weight: 700;
}

.tls-paper-parties p {
	margin: 5px 0 0;
	color: #667085;
	font-size: 8.5px;
	line-height: 1.55;
	white-space: pre-line;
	word-break: break-word;
}

.tls-paper-items {
	overflow: hidden;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
}

.tls-paper-items-head,
.tls-paper-item-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 46px 78px 88px;
	gap: 10px;
	align-items: center;
}

.tls-paper-items-head {
	padding: 9px 11px;
	background: var(--paper-primary);
	color: #fff;
	font-size: 7.5px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.tls-paper-items-head span:not(:first-child),
.tls-paper-item-row span:not(:first-child) {
	text-align: right;
}

.tls-paper-item-row {
	padding: 10px 11px;
	border-bottom: 1px solid #eaecf0;
	color: #475467;
	font-size: 8.5px;
}

.tls-paper-item-row:last-child {
	border-bottom: 0;
}

.tls-paper-item-row strong {
	display: block;
	color: #344054;
	font-size: 9px;
	font-weight: 600;
}

.tls-paper-item-row small {
	display: block;
	margin-top: 2px;
	color: #98a2b3;
	font-size: 7px;
	line-height: 1.4;
}

.tls-paper-summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 230px;
	gap: 24px;
	align-items: start;
	padding: 22px 0;
}

.tls-paper-notes p,
.tls-paper-footer-content p {
	margin: 0;
	color: #667085;
	font-size: 8.5px;
	line-height: 1.55;
	white-space: pre-line;
	word-break: break-word;
}

.tls-paper-totals {
	display: grid;
	gap: 8px;
}

.tls-paper-totals > div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	color: #667085;
	font-size: 8.5px;
}

.tls-paper-totals strong {
	color: #344054;
	font-size: 9px;
	font-weight: 600;
}

.tls-paper-grand-total {
	margin-top: 3px;
	padding: 10px 11px;
	border-radius: 7px;
	background: var(--paper-primary);
	color: #fff !important;
}

.tls-paper-grand-total span,
.tls-paper-grand-total strong {
	color: #fff !important;
	font-size: 10px !important;
	font-weight: 700 !important;
}

.tls-paper-footer-content {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	padding: 0 0 26px;
}

.tls-paper-footer {
	padding: 12px 34px;
	background: #f8fafc;
	color: #98a2b3;
	font-size: 7.5px;
	text-align: center;
}

.tls-paper-footer p {
	margin: 0;
}

.template-classic {
	--paper-primary: #1e293b;
	font-family: Georgia, "Times New Roman", serif;
}

.template-classic .tls-paper-accent {
	height: 3px;
}

.template-classic .tls-paper-title h3 {
	letter-spacing: .02em;
}

.template-classic .tls-paper-items-head {
	background: #1e293b;
}

.template-minimal {
	--paper-primary: #111827;
}

.template-minimal .tls-paper-accent {
	display: none;
}

.template-minimal .tls-paper-header {
	padding-top: 39px;
}

.template-minimal .tls-paper-meta > div,
.template-minimal .tls-paper-grand-total {
	border-radius: 0;
}

.template-minimal .tls-paper-items {
	border-radius: 0;
}

.tls-toast {
	position: fixed;
	z-index: 99999;
	right: 22px;
	bottom: 22px;
	display: none;
	max-width: 340px;
	padding: 12px 15px;
	border: 1px solid #dbeafe;
	border-radius: 10px;
	background: #fff;
	color: #344054;
	font-size: 12px;
	font-weight: 600;
	box-shadow: 0 18px 45px rgba(16, 24, 40, .16);
}

.tls-toast.is-visible {
	display: block;
}

@media (max-width: 1180px) {
	.tls-invoice-workspace {
		grid-template-columns: 1fr;
	}

	.tls-invoice-preview-panel {
		position: static;
	}

	.tls-invoice-paper {
		max-width: 760px;
		margin: 0 auto;
	}
}

@media (max-width: 780px) {
	.tls-invoice-app {
		padding: 56px 15px 72px;
	}

	.tls-invoice-header {
		display: block;
	}

	.tls-invoice-header h1 {
		font-size: 37px;
	}

	.tls-invoice-header p {
		font-size: 14px;
	}

	.tls-invoice-privacy {
		margin-top: 17px;
	}

	.tls-panel {
		padding: 17px;
	}

	.tls-panel-heading {
		align-items: flex-start;
	}

	.tls-form-grid-3,
	.tls-form-grid-2,
	.tls-tax-options,
	.tls-adjustments {
		grid-template-columns: 1fr;
	}

	.tls-item-row {
		grid-template-columns: minmax(0, 1fr) 76px;
	}

	.tls-item-row .tls-item-description {
		grid-column: 1 / -1;
	}

	.tls-item-row .tls-item-rate {
		grid-column: 1;
	}

	.tls-item-row .tls-item-total {
		grid-column: 2;
	}

	.tls-item-row .tls-remove-item {
		grid-column: 2;
		justify-self: end;
	}

	.tls-editor-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tls-editor-actions .tls-primary-button {
		grid-column: 1 / -1;
	}

	.tls-invoice-paper {
		min-height: 0;
	}

	.tls-paper-header,
	.tls-paper-meta,
	.tls-paper-parties,
	.tls-paper-items,
	.tls-paper-summary,
	.tls-paper-footer-content {
		margin-right: 18px;
		margin-left: 18px;
	}

	.tls-paper-header {
		display: block;
	}

	.tls-paper-title {
		margin-top: 20px;
		text-align: left;
	}

	.tls-paper-meta {
		grid-template-columns: 1fr;
	}

	.tls-paper-parties,
	.tls-paper-summary,
	.tls-paper-footer-content {
		grid-template-columns: 1fr;
	}

	.tls-paper-items {
		overflow-x: auto;
	}

	.tls-paper-items-head,
	.tls-paper-item-row {
		min-width: 480px;
	}

	.tls-paper-summary {
		gap: 16px;
	}

	.tls-paper-footer {
		padding-right: 18px;
		padding-left: 18px;
	}

	.tls-toast {
		right: 14px;
		bottom: 14px;
		left: 14px;
		max-width: none;
	}
}

@media print {
	body * {
		visibility: hidden !important;
	}

	.tls-invoice-paper,
	.tls-invoice-paper * {
		visibility: visible !important;
	}

	.tls-invoice-paper {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		width: 210mm !important;
		min-height: 297mm !important;
		margin: 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
	}

	@page {
		size: A4;
		margin: 0;
	}
}
