/* Forms, history and profile pages */
.ep-portal-shell {
	max-width: 1120px;
	margin: 0 auto;
	padding: 28px 16px;
	color: var(--ep-text);
	font-family: inherit;
}

.ep-section-heading,
.ep-heading-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.ep-section-heading h2,
.ep-card-heading h2 {
	margin: 4px 0 6px;
	color: var(--ep-text);
	font-size: clamp(23px, 3vw, 30px);
}

.ep-section-heading p {
	margin: 0;
	color: var(--ep-muted);
}

.ep-eyebrow {
	display: inline-block;
	color: var(--ep-primary);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.ep-button-secondary {
	background: #eef1ff;
	color: var(--ep-primary) !important;
	box-shadow: none;
}

.ep-form {
	padding: 26px;
}

.ep-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

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

.ep-field label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 750;
}

.ep-field label span {
	color: var(--ep-red);
}

.ep-field input,
.ep-field textarea,
.ep-field select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d0d8e6;
	border-radius: 11px;
	background: #fff;
	color: var(--ep-text);
	font: inherit;
	box-sizing: border-box;
}

.ep-field input:focus,
.ep-field textarea:focus,
.ep-field select:focus {
	border-color: var(--ep-primary);
	outline: 3px solid rgba(10, 70, 105, .12);
}

.ep-form-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 24px;
}

.ep-calculation-preview {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 22px;
	padding: 18px;
	border-radius: 14px;
	background: #f6f8fc;
}

.ep-calculation-preview div {
	display: grid;
	gap: 5px;
}

.ep-calculation-preview span {
	color: var(--ep-muted);
	font-size: 13px;
}

.ep-calculation-preview strong {
	font-size: 20px;
}

.ep-table-wrap {
	overflow-x: auto;
}

.ep-table {
	width: 100%;
	border-collapse: collapse;
}

.ep-table th,
.ep-table td {
	padding: 15px 18px;
	border-bottom: 1px solid var(--ep-border);
	text-align: left;
	white-space: nowrap;
}

.ep-table th {
	color: var(--ep-muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.ep-table tr:last-child td {
	border-bottom: 0;
}

.ep-text-link {
	color: var(--ep-primary) !important;
	font-weight: 800;
	text-decoration: none !important;
}

.ep-edit-report-button {
	appearance: none;
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	cursor: pointer;
}

.ep-edit-report-button:hover,
.ep-edit-report-button:focus-visible {
	text-decoration: underline !important;
}

.ep-empty-state {
	padding: 46px 24px;
	text-align: center;
}

.ep-empty-state h3 {
	margin: 0 0 8px;
	font-size: 26px;
}

.ep-empty-state p {
	max-width: 560px;
	margin: 0 auto 22px;
	color: var(--ep-muted);
}

.ep-notice {
	margin-bottom: 17px;
	padding: 13px 15px;
	border: 1px solid;
	border-radius: 11px;
	font-size: 13px;
	font-weight: 700;
}

.ep-notice-success {
	border-color: #abefc6;
	background: #ecfdf3;
	color: #067647;
}

.ep-notice-error {
	border-color: #fecdca;
	background: #fef3f2;
	color: #b42318;
}

.ep-notice-warning {
	border-color: #fedf89;
	background: #fffaeb;
	color: #b54708;
}

@media (max-width: 1180px) {
	.ep-app {
		grid-template-columns: 205px minmax(0, 1fr);
	}

	.ep-app-main {
		padding: 24px;
	}

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

@media (max-width: 900px) {
	.ep-app-wrap {
		width: calc(100vw - 12px) !important;
		max-width: none !important;
		margin-top: 6px;
		margin-bottom: 6px;
		margin-left: calc(50% - 50vw + 6px) !important;
		margin-right: calc(50% - 50vw + 6px) !important;
	}

	.ep-app {
		display: block;
		border-radius: 18px;
	}

	.ep-app-sidebar {
		display: none;
	}

	.ep-mobile-brand {
		display: block;
	}

	.ep-primary-grid,
	.ep-secondary-grid {
		grid-template-columns: 1fr;
	}

	.ep-month-tabs {
		grid-template-columns: repeat(12, 62px);
	}
}

@media (max-width: 650px) {
	.ep-app-main {
		padding: 18px 13px 24px;
	}

	.ep-app-header,
	.ep-section-heading,
	.ep-heading-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.ep-header-actions {
		width: 100%;
	}

	.ep-header-actions a,
	.ep-header-actions button {
		flex: 1;
	}

	.ep-kpi-grid,
	.ep-form-grid,
	.ep-calculation-preview {
		grid-template-columns: 1fr;
	}

	.ep-field-full {
		grid-column: auto;
	}

	.ep-donut-layout {
		grid-template-columns: 1fr;
	}

	.ep-chart-donut {
		height: 175px;
	}

	.ep-expense-legend {
		grid-template-columns: repeat(2, 1fr);
	}

	.ep-chart-large {
		height: 260px;
	}

	.ep-chart-medium {
		height: 190px;
	}

	.ep-cashflow-card,
	.ep-expense-card,
	.ep-profit-card,
	.ep-recent-card,
	.ep-form {
		padding: 17px;
	}

	.ep-inline-empty {
		align-items: flex-start;
		flex-direction: column;
	}

	.ep-table,
	.ep-table tbody,
	.ep-table tr,
	.ep-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.ep-table thead {
		display: none;
	}

	.ep-table tr {
		padding: 12px 0;
		border-bottom: 1px solid var(--ep-border);
	}

	.ep-table td {
		display: flex;
		justify-content: space-between;
		gap: 20px;
		padding: 8px 16px;
		border: 0;
		white-space: normal;
		text-align: right;
	}

	.ep-table td::before {
		content: attr(data-label);
		color: var(--ep-muted);
		font-weight: 800;
		text-align: left;
	}
}


/* Dashboard financial report modal */
body.ep-modal-open {
	overflow: hidden !important;
}

.ep-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .18s ease, visibility .18s ease;
}

.ep-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.ep-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 18, 35, .66);
	backdrop-filter: blur(5px);
}

.ep-modal-dialog {
	position: relative;
	z-index: 1;
	width: min(760px, 100%);
	max-height: min(90vh, 820px);
	overflow-y: auto;
	border: 1px solid rgba(255, 255, 255, .72);
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 28px 90px rgba(10, 18, 35, .32);
	transform: translateY(18px) scale(.985);
	transition: transform .2s ease;
}

.ep-modal.is-open .ep-modal-dialog {
	transform: translateY(0) scale(1);
}

.ep-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 25px 26px 19px;
	border-bottom: 1px solid var(--ep-border);
}

.ep-modal-header h2 {
	margin: 4px 0 5px;
	color: var(--ep-text);
	font-size: 25px;
	line-height: 1.2;
}

.ep-modal-header p {
	margin: 0;
	color: var(--ep-muted);
	font-size: 13px;
}

.ep-modal-close {
	display: grid;
	place-items: center;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--ep-border);
	border-radius: 11px;
	background: #f8f9fc;
	color: var(--ep-text);
	font: 400 27px/1 system-ui, sans-serif;
	cursor: pointer;
}

.ep-modal-close:hover {
	background: #eef1f7;
}

.ep-modal-form {
	padding: 23px 26px 26px;
	box-shadow: none;
}

.ep-modal-note {
	margin: 13px 0 0;
	color: var(--ep-muted);
	font-size: 12px;
}

.ep-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

@media (max-width: 650px) {
	.ep-modal {
		align-items: end;
		padding: 0;
	}

	.ep-modal-dialog {
		width: 100%;
		max-height: 92vh;
		border-radius: 22px 22px 0 0;
	}

	.ep-modal-header,
	.ep-modal-form {
		padding-right: 18px;
		padding-left: 18px;
	}

	.ep-modal-actions {
		position: sticky;
		bottom: -26px;
		margin-right: -18px;
		margin-left: -18px;
		padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--ep-border);
		background: #fff;
	}

	.ep-modal-actions .ep-button {
		flex: 1;
	}
}

/* Business logo — v0.2.4 */
.ep-brand-logo {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 11px;
	background: #fff;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.ep-brand-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ep-brand > strong {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ep-logo-uploader {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 18px;
	border: 1px dashed #c8d2e4;
	border-radius: 14px;
	background: #f8faff;
}

.ep-logo-preview {
	display: grid;
	place-items: center;
	width: 96px;
	height: 96px;
	flex: 0 0 96px;
	overflow: hidden;
	border: 1px solid var(--ep-border);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(30, 45, 80, .08);
}

.ep-logo-preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ep-logo-placeholder {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: linear-gradient(135deg, #7287ff, #4258e9);
	color: #fff;
}

.ep-logo-placeholder svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ep-logo-uploader-copy {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.ep-logo-uploader-copy > strong {
	font-size: 16px;
}

.ep-logo-uploader-copy > p {
	margin: 0;
	color: var(--ep-muted);
	font-size: 13px;
	line-height: 1.5;
}

.ep-field .ep-logo-input {
	max-width: 460px;
	padding: 8px;
	background: #fff;
}

.ep-logo-input::file-selector-button {
	margin-right: 10px;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: var(--ep-primary);
	color: #fff;
	font-weight: 750;
	cursor: pointer;
}

.ep-logo-remove {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	margin: 2px 0 0 !important;
	color: var(--ep-muted);
	font-size: 13px !important;
	font-weight: 650 !important;
}

.ep-logo-remove input {
	width: auto;
	margin: 0;
}

@media (max-width: 650px) {
	.ep-logo-uploader {
		align-items: flex-start;
		flex-direction: column;
	}

	.ep-logo-preview {
		width: 82px;
		height: 82px;
		flex-basis: 82px;
	}
}


/* App-style financial history */
.ep-history-app .ep-app {
	min-height: 760px;
}

.ep-history-table-card {
	overflow: hidden;
}

.ep-history-table-card .ep-table th {
	background: #f8faff;
}

.ep-history-table-card .ep-table tbody tr:hover {
	background: #fbfcff;
}

.ep-history-table-card .ep-table td strong {
	color: var(--ep-text);
}


/* Business profile inside the shared portal shell */
.ep-profile-app .ep-app-main {
	padding-bottom: 38px;
}

.ep-profile-header {
	margin-bottom: 22px;
}

.ep-profile-card {
	width: 100%;
}

.ep-profile-card .ep-logo-field {
	margin-bottom: 2px;
}

.ep-profile-card .ep-form-actions {
	padding-top: 4px;
}
