*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
body {
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	background: hsl(35, 100%, 94%);
	color: hsl(28, 45%, 15%);
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.header {
	background: hsl(35, 100%, 94%);
	padding: 20px 27px;
	border-bottom: 1px solid #DFB793;
	position: sticky;
	top: 0;
	z-index: 50;
}
.header-inner {
	max-width: 1600px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
}
.logo {
	text-decoration: none;
	display: flex;
	align-items: center;
}
.logo img {
	height: 60px;
	width: auto;
	display: block;
}
.nav {
	display: flex;
	gap: 8px;
}
.nav a {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 500;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 11px;
	transition: background 0.15s;
}
.nav a:hover {
	background: hsl(28, 45%, 15% / 0.1);
}
.nav a.active {
	background: #fff;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}
.header-title {
	flex: 1;
	text-align: center;
	padding: 0 12px;
	line-height: 1.3;
}
.header-title-text {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: hsl(28, 45%, 15%);
	display: block;
}
.header-subtitle-text {
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: hsl(28, 41%, 53%);
	display: block;
}
.user-menu {
	display: flex;
	align-items: center;
	gap: 8px;
}
.user-name {
	font-size: 13px;
	color: hsl(28, 41%, 53%);
	white-space: nowrap;
}
.main {
	flex: 1;
	max-width: 1600px;
	width: 100%;
	margin: 0 auto;
	padding: 0 27px 48px;
	overflow: auto;
}
.main > :first-child {
	margin-top: 24px;
}
.page-title {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: hsl(28, 45%, 15%);
	margin-bottom: 8px;
}
.page-subtitle {
	font-size: 16px;
	color: hsl(28, 41%, 53%);
	margin-bottom: 36px;
}
.btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 14px;
	padding: 10px 20px;
	border-radius: 12px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: all 0.15s;
}
.btn-primary {
	background: hsl(13, 92%, 60%);
	color: #fff;
}
.btn-primary:hover {
	background: hsl(13, 80%, 50%);
}
.btn-secondary {
	background: hsl(34, 100%, 65%);
	color: hsl(28, 45%, 15%);
}
.btn-secondary:hover {
	background: hsl(34, 90%, 55%);
}
.btn-ghost {
	background: transparent;
	color: hsl(28, 45%, 15%);
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 13px;
}
.btn-ghost:hover {
	background: hsl(28, 45%, 15% / 0.1);
}
.btn-danger {
	background: transparent;
	color: hsl(13, 92%, 50%);
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 13px;
}
.btn-danger:hover {
	background: hsl(13, 92%, 60% / 0.15);
	color: hsl(13, 92%, 35%);
}
.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 8px;
}
.search-input {
	padding: 8px 14px;
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	background: #fff;
	border: 1px solid #DFB793;
	border-radius: 12px;
	outline: none;
	transition: border-color 0.15s;
	min-width: 200px;
}
.search-input:focus {
	border-color: hsl(13, 92%, 60%);
}
.toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}
.table-wrapper {
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
	overflow: hidden;
}
table {
	width: 100%;
	border-collapse: collapse;
}
th {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #fff;
	padding: 16px 20px;
	text-align: left;
	white-space: nowrap;
	background: hsl(13, 92%, 60%);
	position: sticky;
	top: 0;
	z-index: 2;
}
th:not(:last-child) {
	border-right: 1px solid hsl(13, 92%, 55%);
}
.sort-link {
	color: #fff;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.sort-link:hover {
	color: hsl(35, 100%, 94%);
	text-decoration: underline;
}
.sort-link::after {
	content: '↕';
	font-size: 11px;
	opacity: 0.6;
}
th.sort-asc::after {
	content: ' ▲';
	font-size: 10px;
}
th.sort-desc::after {
	content: ' ▼';
	font-size: 10px;
}
td {
	padding: 14px 20px;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	border-bottom: 1px solid #DFB793;
	vertical-align: middle;
}
tr:last-child td {
	border-bottom: none;
}
tr:hover td {
	background: hsl(35, 100%, 94%);
}
.type-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 600;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}
.type-grants {
	background: hsl(13, 92%, 60% / 0.15);
	color: hsl(13, 92%, 40%);
}
.type-investments {
	background: hsl(170, 71%, 47% / 0.15);
	color: hsl(170, 71%, 30%);
}
.type-other {
	background: hsl(34, 100%, 65% / 0.2);
	color: hsl(28, 45%, 30%);
}
.source-link {
	color: hsl(13, 92%, 50%);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.15s;
	word-break: break-all;
}
.source-link:hover {
	color: hsl(13, 92%, 35%);
	text-decoration: underline;
}
.description-text {
	color: hsl(28, 41%, 53%);
	font-size: 13px;
	line-height: 1.5;
}
.id-cell {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	color: hsl(28, 41%, 53%);
	width: 40px;
}
.name-cell {
	font-weight: 600;
	min-width: 200px;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.actions-cell {
	white-space: nowrap;
	width: 1px;
}
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 16px;
	color: hsl(28, 41%, 53%);
	transition: all 0.15s;
}
.icon-btn:hover {
	background: hsl(28, 45%, 15% / 0.1);
	color: hsl(28, 45%, 15%);
}
.icon-btn-danger {
	color: hsl(13, 92%, 50%);
}
.icon-btn-danger:hover {
	background: hsl(13, 92%, 60% / 0.15);
	color: hsl(13, 92%, 35%);
}
.empty-state {
	padding: 60px 20px;
	text-align: center;
	color: hsl(28, 41%, 53%);
}
.muted { color: hsl(28, 41%, 53%); }
.amount.positive { color: hsl(170, 71%, 35%); }
.amount.negative { color: hsl(13, 92%, 50%); }
.account-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.account-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 9999px;
	font-size: 13px;
	font-weight: 500;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	border: 2px solid #DFB793;
	background: #fff;
	color: hsl(28, 45%, 15%);
	cursor: pointer;
	transition: all 0.15s;
}
.account-tag:hover {
	border-color: hsl(13, 92%, 60%);
	background: hsl(35, 100%, 94%);
}
.account-tag-active {
	border-color: hsl(13, 92%, 60%);
	background: hsl(13, 92%, 60%);
	color: #fff;
}
.account-tag-active .account-tag-type {
	color: hsl(13, 92%, 90%);
}

.account-tag-active:hover {
	background: hsl(13, 80%, 50%);
	border-color: hsl(13, 80%, 50%);
}
.account-tag-type {
	font-weight: 600;
	color: hsl(28, 41%, 53%);
}

.account-tag-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 700;
	background: hsl(170, 71%, 47% / 0.15);
	color: hsl(170, 71%, 35%);
}
.account-tag-count-zero {
	background: hsl(28, 41%, 53% / 0.15);
	color: hsl(28, 41%, 53%);
}
.account-tag-active .account-tag-count {
	background: hsl(13, 92%, 90%);
	color: hsl(13, 92%, 60%);
}
.account-tag-active .account-tag-count-zero {
	background: hsl(13, 92%, 90% / 0.3);
	color: hsl(13, 92%, 90%);
}
.account-tag-hidden {
	opacity: 0.4;
	pointer-events: none;
	filter: grayscale(80%);
}
.form-card {
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
	padding: 36px;
	max-width: 640px;
}
.form-group {
	margin-bottom: 24px;
}
.form-group label {
	display: block;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	margin-bottom: 8px;
}
.form-group input,
.form-group textarea,
.form-group select {
	width: 100%;
	padding: 12px 16px;
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	background: #fff;
	border: 1px solid #DFB793;
	border-radius: 12px;
	outline: none;
	transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
	border-color: hsl(13, 92%, 60%);
}
.form-group textarea {
	min-height: 100px;
	resize: vertical;
}
.form-actions {
	display: flex;
	gap: 12px;
	margin-top: 32px;
}
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 48px;
}
.card {
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
	padding: 28px;
	transition: box-shadow 0.15s;
}
.card-link {
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
	padding: 28px;
	transition: box-shadow 0.15s;
	text-decoration: none;
	color: inherit;
	display: block;
}
.card-link:hover {
	box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
}
.card:hover {
	box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
}
.card-value {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 700;
	font-size: 42px;
	color: hsl(13, 92%, 60%);
	line-height: 1;
	margin-bottom: 6px;
}
.card-label {
	font-size: 14px;
	color: hsl(28, 41%, 53%);
}
.card-icon {
	display: inline-flex;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	font-size: 22px;
}
.icon-grants {
	background: hsl(13, 92%, 60% / 0.15);
	color: hsl(13, 92%, 50%);
}
.icon-investments {
	background: hsl(170, 71%, 47% / 0.15);
	color: hsl(170, 71%, 40%);
}
.icon-sources {
	background: hsl(34, 100%, 65% / 0.2);
	color: hsl(28, 45%, 40%);
}
.welcome-hero {
	margin-bottom: 48px;
}
.welcome-hero h1 {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 18px;
	color: hsl(28, 45%, 15%);
	margin-bottom: 8px;
}
.welcome-hero p {
	font-size: 18px;
	color: hsl(28, 41%, 53%);
	max-width: 560px;
	line-height: 1.6;
}
.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 9999px;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 13px;
}
.status-connected {
	background: hsl(170, 71%, 47% / 0.15);
	color: hsl(170, 71%, 30%);
}
.status-disconnected {
	background: hsl(13, 92%, 60% / 0.15);
	color: hsl(13, 92%, 40%);
}
.footer {
	background: #F1DDC6;
	padding: 24px 27px;
	text-align: center;
}
.footer p {
	font-size: 13px;
	color: hsl(28, 41%, 53%);
}
@media (max-width: 768px) {
	.main {
		padding: 12px 16px 32px;
	}
	.header-title-text {
		font-size: 16px;
	}
	.welcome-hero h1 {
		font-size: 18px;
	}
	.welcome-hero p {
		font-size: 15px;
	}
	.table-wrapper {
		border-radius: 12px;
	}
	th, td {
		padding: 10px 12px;
		font-size: 13px;
	}
	th {
		font-size: 11px;
		padding: 12px;
	}
	.name-cell {
		min-width: 120px;
		max-width: 200px;
	}
	.form-card {
		padding: 24px;
	}
		.card-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}
	.card-value {
		font-size: 28px;
	}
	.card-icon {
		width: 36px;
		height: 36px;
		font-size: 16px;
		margin-bottom: 10px;
	}
	.card, .card-link {
		padding: 16px;
	}


	.toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.search-input {
		width: 100%;
		min-width: 0;
	}
	.header-inner {
		flex-wrap: wrap;
	}
	.nav {
		margin-left: 0;
		width: 100%;
		flex-wrap: wrap;
		gap: 4px;
	}
	.nav a {
		font-size: 13px;
		padding: 6px 12px;
	}
	.pagination-info {
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	.header {
		padding: 12px 16px;
	}
	.logo img {
		height: 48px;
	}
	.main {
		padding: 8px 12px 24px;
	}
	.header-title-text {
		font-size: 14px;
	}
	.welcome-hero h1 {
		font-size: 18px;
	}
	.welcome-hero p {
		font-size: 14px;
	}
	th, td {
		padding: 8px 10px;
		font-size: 12px;
	}
	th {
		font-size: 10px;
		padding: 10px;
	}
	.name-cell {
		min-width: 100px;
		max-width: 160px;
	}
	.card-value {
		font-size: 22px;
	}
	.card, .card-link {
		padding: 12px;
	}
	.card-icon {
		width: 32px;
		height: 32px;
		font-size: 14px;
		margin-bottom: 8px;
		border-radius: 10px;
	}
	.card-grid {
		gap: 10px;
		margin-bottom: 24px;
	}
	.form-card {
		padding: 16px;
	}
	.form-actions {
		flex-direction: column;
	}
	.form-actions .btn {
		width: 100%;
		justify-content: center;
	}
	.nav a {
		font-size: 12px;
		padding: 5px 10px;
	}
	.empty-state {
		padding: 32px 16px;
		font-size: 14px;
	}
.ec-content {
	color: hsl(28, 41%, 53%);
	line-height: 1.7;
	font-size: 14px;
	overflow-x: auto;
}
.ec-content h4 {
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 16px;
	color: hsl(28, 45%, 15%);
	margin: 20px 0 10px;
}
.ec-content h5 {
	font-weight: 600;
	font-size: 14px;
	color: hsl(28, 45%, 15%);
	margin: 16px 0 8px;
}
.ec-content p {
	margin-bottom: 10px;
}
.ec-content p:last-child {
	margin-bottom: 0;
}
.ec-content ul, .ec-content ol {
	margin: 8px 0 12px 20px;
}
.ec-content li {
	margin-bottom: 4px;
}
.ec-content table {
	background: #fff;
	border-radius: 12px;
	border: 1px solid #DFB793;
	border-collapse: separate;
	margin: 12px 0;
	width: 100%;
}
.ec-content table th {
	background: hsl(13, 92%, 60%);
	color: #fff;
	font-family: 'Montserrat', Arial, Helvetica, sans-serif;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 10px 14px;
	text-align: left;
	white-space: nowrap;
}
.ec-content table td {
	padding: 10px 14px;
	font-size: 13px;
	border-bottom: 1px solid #DFB793;
	color: hsl(28, 45%, 15%);
}
.ec-content table tr:last-child td {
	border-bottom: none;
}
.ec-content strong {
	color: hsl(28, 45%, 15%);
}
.ec-content a {
	color: hsl(13, 92%, 50%);
	text-decoration: underline;
}
.ec-content a:hover {
	color: hsl(13, 92%, 35%);
}
}
