/**
 * Matter Tracker — frontend dashboard.
 */

.mt-dash {
	--mt-navy: #1b365d;
	--mt-navy-deep: #0e1f38;
	--mt-gold: #c9a227;
	--mt-gold-soft: #f3e7c2;
	--mt-ink: #172033;
	--mt-muted: #5c6778;
	--mt-line: rgba(27, 54, 93, 0.12);
	--mt-card: rgba(255, 255, 255, 0.92);
	--mt-ok: #1f7a4d;
	--mt-err: #a61f24;
	--mt-amber: #b36b00;
	--mt-radius: 18px;
	--mt-shadow: 0 18px 50px rgba(14, 31, 56, 0.12);
	--mt-font: "DM Sans", "Segoe UI", sans-serif;
	--mt-display: "Source Serif 4", Georgia, serif;

	font-family: var(--mt-font);
	color: var(--mt-ink);
	line-height: 1.55;
	margin: 0 auto;
	max-width: 1180px;
	padding: 0 0 64px;
	position: relative;
}

.mt-dash::before {
	content: "";
	position: absolute;
	inset: -24px -16px auto;
	height: 280px;
	background:
		radial-gradient(ellipse 80% 70% at 10% 0%, rgba(201, 162, 39, 0.18), transparent 55%),
		linear-gradient(160deg, #12243f 0%, #1b365d 48%, #243f66 100%);
	border-radius: 0 0 28px 28px;
	z-index: 0;
	pointer-events: none;
}

.mt-dash > * {
	position: relative;
	z-index: 1;
}

.mt-dash__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	padding: 28px 8px 18px;
	color: #fff;
}

.mt-dash__brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.mt-dash__logo {
	max-height: 56px;
	width: auto;
	max-width: 160px;
	object-fit: contain;
	background: #fff;
	border-radius: 10px;
	padding: 6px;
}

.mt-dash__logo--sm {
	max-height: 44px;
}

.mt-dash__eyebrow {
	margin: 0;
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.82;
}

.mt-dash__brand-title,
.mt-dash__title {
	font-family: var(--mt-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	margin: 4px 0 0;
	line-height: 1.15;
}

.mt-dash__brand-title {
	font-size: clamp(1.6rem, 2.4vw, 2.15rem);
	color: #fff;
}

.mt-dash__title {
	font-size: clamp(1.8rem, 3vw, 2.4rem);
	color: var(--mt-navy);
}

.mt-dash__lede {
	color: var(--mt-muted);
	max-width: 42rem;
}

.mt-dash__muted {
	color: var(--mt-muted);
	font-size: 0.92rem;
}

.mt-dash__user {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 0.92rem;
}

.mt-dash__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px;
	margin: 0 0 22px;
	background: rgba(255, 255, 255, 0.14);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
}

.mt-dash__nav-item {
	color: rgba(255, 255, 255, 0.88);
	text-decoration: none;
	padding: 10px 16px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.92rem;
	position: relative;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.mt-dash__nav-item:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: translateY(-1px);
}

.mt-dash__nav-item.is-active {
	background: #fff;
	color: var(--mt-navy);
}

.mt-dash__nav-item.is-active::after {
	content: "";
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 6px;
	height: 2px;
	background: var(--mt-gold);
	border-radius: 2px;
	animation: mt-underline 0.35s ease;
}

.mt-dash__nav-item--cta {
	background: var(--mt-gold);
	color: var(--mt-navy-deep);
	margin-left: auto;
}

.mt-dash__nav--tabs {
	border-radius: 16px;
}

.mt-dash__main {
	display: grid;
	gap: 18px;
	padding: 0 4px;
}

.mt-dash--login {
	min-height: 70vh;
	display: grid;
	place-items: center;
	padding-top: 40px;
}

.mt-dash--login::before {
	height: 100%;
	inset: -24px -16px;
	border-radius: 28px;
}

.mt-dash__login-panel {
	width: min(440px, 100%);
	background: var(--mt-card);
	border-radius: var(--mt-radius);
	box-shadow: var(--mt-shadow);
	padding: 32px 28px;
	animation: mt-rise 0.55s ease both;
}

.mt-dash__login-brand {
	margin-bottom: 22px;
}

.mt-panel {
	background: var(--mt-card);
	border: 1px solid var(--mt-line);
	border-radius: var(--mt-radius);
	box-shadow: var(--mt-shadow);
	padding: 22px 22px 24px;
}

.mt-panel--highlight {
	border-color: rgba(201, 162, 39, 0.45);
	background: linear-gradient(180deg, #fffdf7, #fff);
}

.mt-panel__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.mt-panel__title {
	font-family: var(--mt-display);
	font-size: 1.35rem;
	margin: 0 0 8px;
	color: var(--mt-navy);
}

.mt-dash__hero-stats {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 4px;
}

.mt-stat {
	background: var(--mt-card);
	border-radius: 16px;
	padding: 16px 14px;
	border: 1px solid var(--mt-line);
	box-shadow: var(--mt-shadow);
}

.mt-stat__value {
	display: block;
	font-family: var(--mt-display);
	font-size: 1.85rem;
	color: var(--mt-navy);
	line-height: 1;
}

.mt-stat__label {
	display: block;
	margin-top: 8px;
	font-size: 0.82rem;
	color: var(--mt-muted);
}

.mt-dash__form {
	display: grid;
	gap: 14px;
}

.mt-dash__form--grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mt-dash__form--compact {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--mt-line);
}

.mt-dash__field {
	display: grid;
	gap: 6px;
	font-weight: 600;
	font-size: 0.88rem;
}

.mt-dash__field--full {
	grid-column: 1 / -1;
}

.mt-dash__field input,
.mt-dash__field select,
.mt-dash__field textarea {
	font: inherit;
	font-weight: 400;
	padding: 11px 12px;
	border: 1px solid var(--mt-line);
	border-radius: 12px;
	background: #fff;
	color: var(--mt-ink);
}

.mt-dash__field input:focus,
.mt-dash__field select:focus,
.mt-dash__field textarea:focus {
	outline: 2px solid rgba(201, 162, 39, 0.45);
	border-color: var(--mt-gold);
}

.mt-dash__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.mt-check-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
}

.mt-dash__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	cursor: pointer;
	text-decoration: none;
	font: inherit;
	font-weight: 700;
	border-radius: 999px;
	padding: 11px 18px;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mt-dash__btn:hover {
	transform: translateY(-1px);
}

.mt-dash__btn--primary {
	background: var(--mt-navy);
	color: #fff;
	box-shadow: 0 10px 24px rgba(27, 54, 93, 0.25);
}

.mt-dash__btn--ghost {
	background: transparent;
	color: var(--mt-navy);
	border: 1px solid var(--mt-line);
}

.mt-dash__btn--sm {
	padding: 6px 12px;
	font-size: 0.82rem;
}

.mt-dash__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.mt-dash__link {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.mt-dash__main .mt-dash__link {
	color: var(--mt-navy);
}

.mt-dash__link--danger {
	color: var(--mt-err) !important;
}

.mt-dash__alert {
	padding: 12px 14px;
	border-radius: 12px;
	font-weight: 560;
}

.mt-dash__alert--ok {
	background: #e8f6ee;
	color: var(--mt-ok);
}

.mt-dash__alert--error {
	background: #fdecec;
	color: var(--mt-err);
}

.mt-table-wrap {
	overflow-x: auto;
}

.mt-table {
	width: 100%;
	border-collapse: collapse;
}

.mt-table th,
.mt-table td {
	text-align: left;
	padding: 12px 10px;
	border-bottom: 1px solid var(--mt-line);
	vertical-align: top;
}

.mt-table th {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--mt-muted);
}

.mt-table__link {
	color: var(--mt-navy);
	font-weight: 700;
	text-decoration: none;
}

.mt-table__link:hover {
	text-decoration: underline;
}

.mt-dash__back {
	margin: 0 0 16px;
}

.mt-profile {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 18px 28px;
	margin: 0;
}

.mt-profile__row {
	margin: 0;
}

.mt-profile__row dt {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--mt-muted);
	margin: 0 0 4px;
}

.mt-profile__row dd {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--mt-ink);
	word-break: break-word;
}

.mt-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	background: #eef2f7;
	color: var(--mt-navy);
}

.mt-pill--green { background: #e5f5ec; color: var(--mt-ok); }
.mt-pill--amber { background: #fff1d6; color: var(--mt-amber); }
.mt-pill--red { background: #fde8e8; color: var(--mt-err); animation: mt-pulse 2.2s ease infinite; }
.mt-pill--gold { background: var(--mt-gold-soft); color: #7a5d10; }
.mt-pill--neutral { background: #eef2f7; color: var(--mt-muted); }

.mt-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.mt-list__item {
	padding: 12px 0;
	border-bottom: 1px solid var(--mt-line);
	display: grid;
	gap: 4px;
}

.mt-list__item--row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
}

.mt-list__item a {
	color: inherit;
	text-decoration: none;
	display: grid;
	gap: 4px;
}

.mt-feed {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 14px;
}

.mt-feed__item {
	padding: 14px 0;
	border-bottom: 1px solid var(--mt-line);
}

.mt-feed__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 8px;
	color: var(--mt-muted);
	font-size: 0.86rem;
}

.mt-stage-now {
	font-family: var(--mt-display);
	font-size: 1.5rem;
	color: var(--mt-navy);
	margin: 0 0 28px !important;
}

.mt-dash .mt-progress-wrap,
.mt-progress-wrap {
	width: 100%;
	max-width: 100%;
	overflow: visible;
}

.mt-dash .mt-progress,
.mt-progress {
	list-style: none !important;
	margin: 8px 0 12px !important;
	padding: 0 !important;
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start !important;
	justify-content: space-between !important;
	gap: 0 !important;
	position: relative !important;
	width: 100%;
	box-sizing: border-box;
}

.mt-dash .mt-progress__line,
.mt-progress__line {
	position: absolute !important;
	left: 8%;
	right: 8%;
	top: 9px;
	height: 2px;
	background: #d5dbe3;
	z-index: 0;
	display: block !important;
	pointer-events: none;
}

.mt-dash .mt-progress__step,
.mt-progress__step {
	flex: 1 1 0 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-align: center !important;
	position: relative !important;
	z-index: 1;
	min-width: 0 !important;
	padding: 0 6px !important;
	margin: 0 !important;
	list-style: none !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

.mt-dash .mt-progress__step::before,
.mt-dash .mt-progress__step::after,
.mt-progress__step::before,
.mt-progress__step::after {
	content: none !important;
	display: none !important;
}

.mt-dash .mt-progress__node,
.mt-progress__node {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	border-radius: 50% !important;
	border: 2px solid #c5ced8 !important;
	background: #ffffff !important;
	box-sizing: border-box !important;
	display: block !important;
	margin: 0 0 12px !important;
	padding: 0 !important;
	transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.mt-dash .mt-progress__step--complete .mt-progress__node,
.mt-progress__step--complete .mt-progress__node {
	background: #c9a227 !important;
	border-color: #c9a227 !important;
}

.mt-dash .mt-progress__step--current .mt-progress__node,
.mt-progress__step--current .mt-progress__node {
	background: #c9a227 !important;
	border-color: #c9a227 !important;
	box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.28) !important;
}

.mt-dash .mt-progress__label,
.mt-progress__label {
	font-size: 0.82rem !important;
	line-height: 1.35 !important;
	color: #9aa3ad !important;
	font-weight: 500 !important;
	max-width: 7.5rem;
	display: block !important;
}

.mt-dash .mt-progress__step--complete .mt-progress__label,
.mt-progress__step--complete .mt-progress__label {
	color: #1b365d !important;
	font-weight: 600 !important;
}

.mt-dash .mt-progress__step--current .mt-progress__label,
.mt-progress__step--current .mt-progress__label {
	color: #1b365d !important;
	font-weight: 700 !important;
}

@media (max-width: 700px) {
	.mt-dash .mt-progress,
	.mt-progress {
		flex-direction: column !important;
		align-items: stretch !important;
		padding-left: 0 !important;
	}

	.mt-dash .mt-progress__line,
	.mt-progress__line {
		left: 8px;
		right: auto;
		top: 12px;
		bottom: 12px;
		width: 2px;
		height: auto;
	}

	.mt-dash .mt-progress__step,
	.mt-progress__step {
		flex-direction: row !important;
		align-items: center !important;
		text-align: left !important;
		gap: 14px;
		padding: 10px 0 !important;
	}

	.mt-dash .mt-progress__node,
	.mt-progress__node {
		margin: 0 !important;
		flex-shrink: 0;
	}

	.mt-dash .mt-progress__label,
	.mt-progress__label {
		max-width: none;
	}
}

.mt-matter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.mt-matter-card {
	display: grid;
	gap: 10px;
	padding: 22px;
	border-radius: var(--mt-radius);
	background: var(--mt-card);
	border: 1px solid var(--mt-line);
	box-shadow: var(--mt-shadow);
	text-decoration: none;
	color: inherit;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mt-matter-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 22px 48px rgba(14, 31, 56, 0.16);
}

.mt-matter-card__title {
	font-family: var(--mt-display);
	font-size: 1.3rem;
	margin: 0;
	color: var(--mt-navy);
}

.mt-matter-card__stage {
	margin: 0;
	color: var(--mt-muted);
}

.mt-matter-card__status {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mt-gold);
	font-weight: 700;
}

.mt-analytics-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 12px;
}

.mt-analytics-card {
	padding: 16px;
	border-radius: 14px;
	background: linear-gradient(180deg, #f8fafc, #fff);
	border: 1px solid var(--mt-line);
}

.mt-analytics-card h3 {
	margin: 0 0 10px;
	font-family: var(--mt-display);
	color: var(--mt-navy);
}

.mt-bars {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.mt-bars li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.mt-info-block + .mt-info-block {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--mt-line);
}

.mt-animate {
	animation: mt-rise 0.55s ease both;
}

.mt-animate:nth-child(2) { animation-delay: 0.05s; }
.mt-animate:nth-child(3) { animation-delay: 0.1s; }
.mt-animate:nth-child(4) { animation-delay: 0.15s; }

@keyframes mt-rise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mt-underline {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

@keyframes mt-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(166, 31, 36, 0.15); }
	50% { box-shadow: 0 0 0 6px rgba(166, 31, 36, 0); }
}

@media (max-width: 900px) {
	.mt-dash__hero-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mt-dash__form--grid,
	.mt-analytics-grid {
		grid-template-columns: 1fr;
	}

	.mt-dash__nav {
		border-radius: 18px;
	}

	.mt-dash__nav-item--cta {
		margin-left: 0;
	}
}

@media (max-width: 700px) {
	.mt-dash__top {
		flex-direction: column;
		align-items: flex-start;
	}

	.mt-table thead {
		display: none;
	}

	.mt-table tr {
		display: grid;
		gap: 8px;
		padding: 14px 0;
		border-bottom: 1px solid var(--mt-line);
	}

	.mt-table td {
		display: grid;
		gap: 4px;
		border: 0;
		padding: 0;
	}

	.mt-table td::before {
		content: attr(data-label);
		font-size: 0.72rem;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		color: var(--mt-muted);
		font-weight: 700;
	}
}
