/**
 * STIDE CRM — visual system.
 *
 * Reference: a credit committee ledger. Hairline rules, tabular figures,
 * brass used only where the period or the target is being marked. The one
 * loud element is the failure-mechanism signal bar; everything else stays
 * quiet so a breach is impossible to miss.
 */

.stide-panel {
	--stide-ink: #101c2e;
	--stide-surface: #ffffff;
	--stide-paper: #f5f7f8;
	--stide-rule: #d9dee3;
	--stide-slate: #5c6875;
	--stide-accent: #8c6d2f;
	--stide-hold: #1e6b4b;
	--stide-watch: #a9741a;
	--stide-breach: #9e2b25;

	--stide-display: "GT Sectra Display", "GT Sectra", Tiempos, Georgia, "Times New Roman", serif;
	--stide-body: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--stide-mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

	background: var(--stide-surface);
	border: 1px solid var(--stide-rule);
	border-top: 2px solid var(--stide-ink);
	color: var(--stide-ink);
	font-family: var(--stide-body);
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 24px;
	-webkit-font-smoothing: antialiased;
}

.stide-panel *,
.stide-panel *::before,
.stide-panel *::after {
	box-sizing: border-box;
}

.stide-panel__head {
	border-bottom: 1px solid var(--stide-rule);
	padding: 18px 22px 14px;
}

.stide-eyebrow {
	color: var(--stide-accent);
	display: block;
	font-family: var(--stide-body);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	margin-bottom: 6px;
	text-transform: uppercase;
}

.stide-panel__title {
	font-family: var(--stide-display);
	font-size: 21px;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1.2;
	margin: 0;
}

.stide-panel__body {
	padding: 22px;
}

.stide-panel--alert {
	border-top-color: var(--stide-breach);
}

.stide-panel--alert .stide-eyebrow {
	color: var(--stide-breach);
}

.stide-panel--locked {
	border-top-color: var(--stide-rule);
}

.stide-locked {
	color: var(--stide-slate);
	font-size: 14px;
	margin: 0;
	padding: 22px;
	text-align: center;
}

/* ---------- headline figure ---------- */

.stide-figure {
	align-items: baseline;
	border-bottom: 1px solid var(--stide-rule);
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
	padding-bottom: 16px;
}

.stide-figure__value {
	font-family: var(--stide-display);
	font-size: 42px;
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1;
}

.stide-figure__label {
	color: var(--stide-slate);
	font-size: 13px;
}

/* ---------- bars ---------- */

.stide-bar {
	margin-bottom: 14px;
}

.stide-bar__head {
	display: flex;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	justify-content: space-between;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
	text-transform: uppercase;
}

.stide-bar__track {
	background: var(--stide-paper);
	border: 1px solid var(--stide-rule);
	height: 10px;
	overflow: hidden;
}

.stide-bar__fill {
	background: var(--stide-ink);
	height: 100%;
	transition: width 0.4s ease;
}

.stide-bar--secondary .stide-bar__fill {
	background: repeating-linear-gradient(
		135deg,
		var(--stide-accent),
		var(--stide-accent) 3px,
		transparent 3px,
		transparent 6px
	);
	background-color: var(--stide-accent);
	opacity: 0.85;
}

/* ---------- stats ---------- */

.stide-stats {
	border-top: 1px solid var(--stide-rule);
	display: grid;
	gap: 0;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	margin: 18px 0 0;
	padding: 0;
}

.stide-stat {
	border-bottom: 1px solid var(--stide-rule);
	border-right: 1px solid var(--stide-rule);
	padding: 12px 16px;
}

.stide-stat:first-child {
	padding-left: 0;
}

.stide-stat:last-child {
	border-right: 0;
}

.stide-stat dt {
	color: var(--stide-slate);
	font-size: 11px;
	letter-spacing: 0.08em;
	margin: 0 0 4px;
	text-transform: uppercase;
}

.stide-stat dd {
	font-family: var(--stide-display);
	font-size: 19px;
	font-variant-numeric: tabular-nums;
	margin: 0;
}

/* ---------- failure mechanisms: the signature element ---------- */

.stide-mechs {
	display: grid;
	gap: 1px;
	background: var(--stide-rule);
	border: 1px solid var(--stide-rule);
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stide-mechs--list {
	grid-template-columns: 1fr;
}

.stide-mech {
	background: var(--stide-surface);
	border-left: 4px solid var(--stide-rule);
	padding: 14px 16px;
	position: relative;
}

.stide-mech.is-hold {
	border-left-color: var(--stide-hold);
}

.stide-mech.is-watch {
	border-left-color: var(--stide-watch);
}

.stide-mech.is-breach {
	background: #fdf6f5;
	border-left-color: var(--stide-breach);
}

.stide-mech__code {
	color: var(--stide-slate);
	display: block;
	font-family: var(--stide-mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	margin-bottom: 6px;
}

.stide-mech.is-breach .stide-mech__code {
	color: var(--stide-breach);
	font-weight: 700;
}

.stide-mech__title {
	font-family: var(--stide-display);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	margin: 0 0 6px;
}

.stide-mech__indicator {
	color: var(--stide-slate);
	font-size: 12px;
	line-height: 1.35;
	margin: 0 0 10px;
}

.stide-mech__reading {
	align-items: baseline;
	border-top: 1px solid var(--stide-rule);
	display: flex;
	gap: 8px;
	justify-content: space-between;
	margin: 0;
	padding-top: 8px;
}

.stide-mech__value {
	font-family: var(--stide-display);
	font-size: 22px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.stide-mech__rule {
	color: var(--stide-slate);
	font-family: var(--stide-mono);
	font-size: 11px;
}

/* ---------- board ---------- */

.stide-panel--wide .stide-panel__body {
	overflow-x: auto;
}

.stide-board {
	display: flex;
	gap: 1px;
	background: var(--stide-rule);
	border: 1px solid var(--stide-rule);
	min-width: 900px;
}

.stide-column {
	background: var(--stide-paper);
	flex: 1 1 0;
	min-width: 150px;
}

.stide-column.is-over {
	background: #eef2f5;
	outline: 2px dashed var(--stide-accent);
	outline-offset: -4px;
}

.stide-column__head {
	background: var(--stide-surface);
	border-bottom: 1px solid var(--stide-rule);
	padding: 10px 12px;
}

.stide-column__code {
	display: block;
	font-family: var(--stide-mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	color: var(--stide-accent);
}

.stide-column__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	margin: 2px 0 4px;
}

.stide-column__meta {
	color: var(--stide-slate);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.stide-column__body {
	min-height: 90px;
	padding: 8px;
}

.stide-card {
	background: var(--stide-surface);
	border: 1px solid var(--stide-rule);
	cursor: grab;
	margin-bottom: 8px;
	padding: 10px;
}

.stide-card:last-child {
	margin-bottom: 0;
}

.stide-card.is-dragging {
	opacity: 0.45;
}

.stide-card__title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 3px;
}

.stide-card__account {
	color: var(--stide-slate);
	font-size: 11px;
	margin: 0 0 6px;
}

.stide-card__line {
	align-items: center;
	display: flex;
	gap: 6px;
	justify-content: space-between;
	margin: 0 0 6px;
}

.stide-card__fee {
	font-family: var(--stide-display);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.stide-card__flags {
	display: flex;
	gap: 4px;
	margin: 0;
}

.stide-card__next {
	border-top: 1px solid var(--stide-rule);
	color: var(--stide-slate);
	font-size: 11px;
	margin: 8px 0 0;
	padding-top: 6px;
}

.stide-card__next time {
	font-family: var(--stide-mono);
}

/* ---------- tags and pills ---------- */

.stide-tag {
	background: var(--stide-paper);
	border: 1px solid var(--stide-rule);
	display: inline-block;
	font-family: var(--stide-mono);
	font-size: 10px;
	letter-spacing: 0.06em;
	padding: 2px 5px;
}

.stide-pill {
	border: 1px solid currentColor;
	display: inline-block;
	font-size: 10px;
	letter-spacing: 0.04em;
	padding: 1px 5px;
	text-transform: uppercase;
}

.stide-pill--pass {
	color: var(--stide-hold);
}

.stide-pill--watch {
	color: var(--stide-watch);
}

.stide-pill--fail {
	color: var(--stide-breach);
}

/* ---------- tables ---------- */

.stide-table {
	border-collapse: collapse;
	font-size: 13px;
	width: 100%;
}

.stide-table th,
.stide-table td {
	border-bottom: 1px solid var(--stide-rule);
	padding: 9px 10px;
	text-align: left;
	vertical-align: top;
}

.stide-table thead th {
	border-bottom: 1px solid var(--stide-ink);
	color: var(--stide-slate);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.stide-table tbody th {
	font-weight: 600;
}

.stide-table tfoot th,
.stide-table tfoot td {
	border-bottom: 0;
	border-top: 2px solid var(--stide-ink);
	font-weight: 600;
}

.stide-num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.stide-sub {
	color: var(--stide-slate);
	font-size: 11px;
	font-weight: 400;
}

.stide-table tr.is-remind td,
.stide-table tr.is-remind th {
	background: #fdfaf2;
}

.stide-table tr.is-call td,
.stide-table tr.is-call th {
	background: #fdf6ea;
}

.stide-table tr.is-escalate td,
.stide-table tr.is-escalate th {
	background: #fdf2f1;
	box-shadow: inset 3px 0 0 var(--stide-breach);
}

.stide-table tr.is-wedge th {
	box-shadow: inset 3px 0 0 var(--stide-accent);
}

.stide-spark {
	background: var(--stide-ink);
	display: block;
	height: 8px;
	min-width: 2px;
}

/* ---------- daily ---------- */

.stide-daily {
	list-style: none;
	margin: 0;
	padding: 0;
}

.stide-daily__row {
	border-bottom: 1px solid var(--stide-rule);
	display: grid;
	gap: 4px 12px;
	grid-template-columns: 1fr auto;
	padding: 10px 0;
}

.stide-daily__row:last-child {
	border-bottom: 0;
}

.stide-daily__label {
	font-size: 13px;
}

.stide-daily__count {
	font-family: var(--stide-display);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.stide-daily__bar {
	background: var(--stide-paper);
	border: 1px solid var(--stide-rule);
	grid-column: 1 / -1;
	height: 6px;
	overflow: hidden;
}

.stide-daily__bar span {
	background: var(--stide-slate);
	display: block;
	height: 100%;
	transition: width 0.4s ease;
}

.stide-daily__row.is-hold .stide-daily__bar span {
	background: var(--stide-hold);
}

.stide-daily__row.is-watch .stide-daily__bar span {
	background: var(--stide-watch);
}

.stide-daily__row.is-breach .stide-daily__bar span {
	background: var(--stide-breach);
}

/* ---------- agenda ---------- */

.stide-agenda {
	counter-reset: agenda;
	list-style: none;
	margin: 0;
	padding: 0;
}

.stide-agenda li {
	border-bottom: 1px solid var(--stide-rule);
	counter-increment: agenda;
	font-size: 13px;
	padding: 10px 0 10px 34px;
	position: relative;
}

.stide-agenda li::before {
	color: var(--stide-accent);
	content: counter(agenda, decimal-leading-zero);
	font-family: var(--stide-mono);
	font-size: 11px;
	left: 0;
	position: absolute;
	top: 12px;
}

.stide-agenda li:last-child {
	border-bottom: 0;
}

/* ---------- form ---------- */

.stide-panel--form .stide-panel__body {
	max-width: 720px;
}

.stide-capture__intro {
	color: var(--stide-slate);
	font-size: 14px;
	margin: 0 0 18px;
}

.stide-capture__grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stide-capture__field {
	display: block;
}

.stide-capture__field--wide {
	margin-top: 14px;
}

.stide-capture__field span {
	color: var(--stide-slate);
	display: block;
	font-size: 11px;
	letter-spacing: 0.08em;
	margin-bottom: 5px;
	text-transform: uppercase;
}

.stide-capture input,
.stide-capture select,
.stide-capture textarea {
	background: var(--stide-surface);
	border: 1px solid var(--stide-rule);
	border-radius: 0;
	color: var(--stide-ink);
	font-family: var(--stide-body);
	font-size: 14px;
	padding: 9px 10px;
	width: 100%;
}

.stide-capture input:focus,
.stide-capture select:focus,
.stide-capture textarea:focus,
.stide-button:focus-visible,
.stide-card:focus-visible {
	outline: 2px solid var(--stide-accent);
	outline-offset: 2px;
}

.stide-button {
	background: var(--stide-ink);
	border: 1px solid var(--stide-ink);
	border-radius: 0;
	color: #fff;
	cursor: pointer;
	font-family: var(--stide-body);
	font-size: 13px;
	letter-spacing: 0.06em;
	margin-top: 18px;
	padding: 11px 22px;
	text-transform: uppercase;
	transition: background 0.2s ease;
}

.stide-button:hover {
	background: var(--stide-accent);
	border-color: var(--stide-accent);
}

.stide-button[disabled] {
	cursor: wait;
	opacity: 0.6;
}

.stide-hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

.stide-capture__status {
	font-size: 13px;
	margin: 12px 0 0;
	min-height: 20px;
}

.stide-capture__status.is-error {
	color: var(--stide-breach);
}

.stide-capture__status.is-success {
	color: var(--stide-hold);
}

/* ---------- misc ---------- */

.stide-hint,
.stide-empty {
	color: var(--stide-slate);
	font-size: 12px;
	margin: 14px 0 0;
}

.stide-empty {
	margin: 0;
}

.stide-flag {
	color: #9e2b25;
	font-size: 11px;
}

.stide-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 600px) {
	.stide-panel__body {
		padding: 16px;
	}

	.stide-figure__value {
		font-size: 32px;
	}

	.stide-mechs {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stide-bar__fill,
	.stide-daily__bar span,
	.stide-button {
		transition: none;
	}
}

@media print {
	.stide-panel {
		border: 1px solid #000;
		break-inside: avoid;
	}

	.stide-hint,
	.stide-button {
		display: none;
	}
}
