/* ------------------------------------------------------------------ */
/*  Dashboard container                                               */
/* ------------------------------------------------------------------ */

#tfs-dashboard {
	max-width: 72rem;
	margin: 0 auto;
	padding: 2rem 1.5rem;
}

/* ------------------------------------------------------------------ */
/*  Filters                                                           */
/* ------------------------------------------------------------------ */

#tfs-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 2rem;
	padding: 1rem 1.25rem;
	background: var(--ast-global-color-4, #ffffff);
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Dropdown wrapper */
.tfs-dropdown {
	position: relative;
}

.tfs-dropdown-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border: 1px solid #dddddd;
	border-radius: 0.5rem;
	background: var(--ast-global-color-5, #f9f9f9);
	cursor: pointer;
	font: inherit;
	font-size: 0.8125rem;
	color: var(--ast-global-color-3, #4B4F58);
	transition: all 0.15s ease;
}

.tfs-dropdown-toggle:hover {
	border-color: #94a3b8;
	background: var(--ast-global-color-6, #F2F5F7);
}

.tfs-dropdown-toggle::after {
	content: '▾';
	font-size: 0.6rem;
	color: #94a3b8;
}

/* Dropdown list */
.tfs-dropdown-list {
	display: none;
	position: absolute;
	top: calc(100% + 0.375rem);
	left: 0;
	min-width: 13rem;
	max-height: 16rem;
	overflow-y: auto;
	background: var(--ast-global-color-4, #ffffff);
	border: 1px solid #dddddd;
	border-radius: 0.5rem;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
	z-index: 100;
	padding: 0.375rem 0;
}

.tfs-dropdown.is-open .tfs-dropdown-list {
	display: block;
}

.tfs-dropdown-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	cursor: pointer;
	font-size: 0.8125rem;
	white-space: nowrap;
	color: var(--ast-global-color-3, #4B4F58);
}

.tfs-select-all {
	font-weight: 600;
	border-bottom: 1px solid var(--ast-global-color-6, #F2F5F7);
	margin-bottom: 0.25rem;
	padding-bottom: 0.5rem;
}

.tfs-dropdown-item:hover {
	background: var(--ast-global-color-5, #f9f9f9);
}

.tfs-dropdown-item input[type="checkbox"] {
	margin: 0;
	accent-color: var(--ast-global-color-0, #21428c);
}

/* Frifond button */
.tfs-frifond-btn {
	padding: 0.5rem 1.25rem;
	border: none;
	border-radius: 0.5rem;
	background: var(--ast-global-color-0, #21428c);
	color: var(--ast-global-color-4, #ffffff);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.tfs-frifond-btn:hover {
	background: var(--ast-global-color-1, #58bcea);
}

/* Reset button */
.tfs-reset-btn {
	padding: 0.5rem 1.25rem;
	border: 1px solid #dddddd;
	border-radius: 0.5rem;
	background: var(--ast-global-color-4, #ffffff);
	color: var(--ast-global-color-3, #4B4F58);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
	transition: all 0.15s ease;
}

.tfs-reset-btn:hover {
	border-color: #94a3b8;
	background: var(--ast-global-color-5, #f9f9f9);
	color: var(--ast-global-color-2, #3a3a3a);
}

/* ------------------------------------------------------------------ */
/*  KPI cards                                                         */
/* ------------------------------------------------------------------ */

#tfs-kpi-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.tfs-kpi-card {
	background: var(--ast-global-color-4, #ffffff);
	border: none;
	border-radius: 0.75rem;
	padding: 1.25rem 1.25rem 1rem;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	border-top: 3px solid #dddddd;
	transition: box-shadow 0.15s ease;
}

.tfs-kpi-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tfs-kpi-value {
	font-size: 1.625rem;
	font-weight: 700;
	color: var(--ast-global-color-2, #3a3a3a);
	line-height: 1.2;
	letter-spacing: -0.025em;
}

.tfs-kpi-label {
	margin-top: 0.375rem;
	font-size: 0.8125rem;
	color: var(--ast-global-color-3, #4B4F58);
	font-weight: 500;
}

/* KPI accent colors */
.tfs-accent-primary   { border-top-color: var(--ast-global-color-0, #21428c); }
.tfs-accent-secondary { border-top-color: var(--ast-global-color-1, #58bcea); }
.tfs-accent-neutral   { border-top-color: #94a3b8; }
.tfs-accent-green     { border-top-color: var(--ast-global-color-7, #75c7ac); }
.tfs-accent-green-alt { border-top-color: var(--ast-global-color-8, #60ba45); }
.tfs-accent-dark      { border-top-color: var(--ast-global-color-2, #3a3a3a); }

/* ------------------------------------------------------------------ */
/*  Budget tracker                                                    */
/* ------------------------------------------------------------------ */

.tfs-budget-card {
	background: var(--ast-global-color-4, #ffffff);
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.tfs-section-heading {
	font-size: 1rem;
	font-weight: inherit;
	color: var(--ast-global-color-2, #3a3a3a);
	margin: 0 0 1.25rem 0;
}

.tfs-section-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	padding: 0.125rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ast-global-color-0, #21428c);
	background: var(--ast-global-color-6, #F2F5F7);
	border-radius: 9999px;
	margin-left: 0.375rem;
	vertical-align: middle;
}

.tfs-progress-row {
	margin-bottom: 1rem;
}

.tfs-progress-row:last-child {
	margin-bottom: 0;
}

.tfs-progress-primary {
	padding-bottom: 1rem;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--ast-global-color-6, #F2F5F7);
}

.tfs-progress-primary .tfs-progress-label {
	font-size: 0.875rem;
	font-weight: 700;
}

.tfs-progress-primary .tfs-progress-track {
	height: 0.75rem;
}

.tfs-progress-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.375rem;
}

.tfs-progress-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ast-global-color-3, #4B4F58);
}

.tfs-progress-stats {
	font-size: 0.75rem;
	color: var(--ast-global-color-3, #4B4F58);
	font-variant-numeric: tabular-nums;
}

.tfs-progress-track {
	width: 100%;
	height: 0.5rem;
	background: var(--ast-global-color-6, #F2F5F7);
	border-radius: 9999px;
	overflow: hidden;
}

.tfs-progress-fill {
	height: 100%;
	border-radius: 9999px;
	transition: width 0.4s ease;
	min-width: 2px;
}

.tfs-progress-pct {
	font-size: 0.6875rem;
	color: #94a3b8;
	margin-top: 0.25rem;
	text-align: right;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.tfs-bar-green  { background: #22c55e; }
.tfs-bar-yellow { background: #eab308; }
.tfs-bar-red    { background: #ef4444; }

.tfs-budget-subtypes {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

.tfs-budget-divider {
	height: 1px;
	background: var(--ast-global-color-6, #F2F5F7);
	margin: 1rem 0;
	border: none;
}

.tfs-budget-other {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}

/* ------------------------------------------------------------------ */
/*  Charts                                                            */
/* ------------------------------------------------------------------ */

.tfs-charts-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}

.tfs-chart-wrap {
	background: var(--ast-global-color-4, #ffffff);
	border: none;
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	padding: 1.25rem;
	position: relative;
	min-height: 20rem;
}

.tfs-chart-wrap canvas {
	width: 100% !important;
	height: 100% !important;
}

.tfs-chart-full {
	margin-top: 1.5rem;
	min-height: 24rem;
}

/* ------------------------------------------------------------------ */
/*  Applications list                                                 */
/* ------------------------------------------------------------------ */

#tfs-applications-list {
	margin-top: 1.5rem;
}

.tfs-section-card {
	background: var(--ast-global-color-4, #ffffff);
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	padding: 1.5rem;
}

.tfs-table-wrap {
	overflow-x: auto;
	margin: 0 -1.5rem -1.5rem;
	padding: 0 1.5rem 1.5rem;
}

.tfs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8125rem;
}

.tfs-table th,
.tfs-table td {
	padding: 0.625rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--ast-global-color-6, #F2F5F7);
}

.tfs-table thead th {
	background: var(--ast-global-color-5, #f9f9f9);
	font-weight: 600;
	white-space: nowrap;
	color: var(--ast-global-color-3, #4B4F58);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.tfs-table tbody tr {
	transition: background 0.1s ease;
}

.tfs-table tbody tr:hover {
	background: var(--ast-global-color-5, #f9f9f9);
}

.tfs-table a {
	color: var(--ast-global-color-0, #21428c);
	text-decoration: none;
	font-weight: 500;
}

.tfs-table a:hover {
	text-decoration: underline;
}

.tfs-col-amount {
	text-align: right !important;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.tfs-type-badge {
	display: inline-block;
	padding: 0.125rem 0.5rem;
	background: var(--ast-global-color-6, #F2F5F7);
	color: var(--ast-global-color-3, #4B4F58);
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 500;
	white-space: nowrap;
}

.tfs-no-results {
	color: var(--ast-global-color-3, #4B4F58);
	font-style: italic;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                        */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
	#tfs-dashboard {
		padding: 5rem 0.75rem 1rem;
	}

	#tfs-kpi-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}

	.tfs-charts-grid {
		grid-template-columns: 1fr;
	}

	.tfs-budget-subtypes {
		grid-template-columns: 1fr;
	}

	.tfs-budget-other {
		grid-template-columns: 1fr;
	}

	.tfs-budget-card,
	.tfs-section-card {
		padding: 1rem;
	}

	.tfs-table-wrap {
		margin: 0 -1rem -1rem;
		padding: 0 1rem 1rem;
	}
}

@media (max-width: 480px) {
	#tfs-kpi-grid {
		grid-template-columns: 1fr;
	}

	.tfs-kpi-value {
		font-size: 1.375rem;
	}
}
