/*
 * AMIK 94 — portal and public form styles.
 * Loaded only on pages that use the plugin shortcodes.
 */

.amik-portal,
.amik-form,
.amik-qr,
.amik-board {
	--ink: #1c1f24;
	--deep: #14171b;
	--soft: #2a2e35;
	--paper: #e8e5df;
	--paper-2: #f2f0eb;
	--copper: #c2703d;
	--copper-light: #d18a5c;
	--copper-ink: #96502a;
	--steel: #5a5f66;
	--steel-light: #9a9ea4;
	--line: rgba(28, 31, 36, .14);
	--line-dark: rgba(232, 229, 223, .14);
	--success: #2f6a49;
	--danger: #96342c;
	--warn: #7a5310;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.6;
	text-align: left;
	box-sizing: border-box;
}

.amik-portal *,
.amik-form *,
.amik-qr *,
.amik-board * {
	box-sizing: border-box;
}

.amik-portal .screen-reader-text,
.amik-form .screen-reader-text,
.amik-qr .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.amik-portal :focus-visible,
.amik-form :focus-visible,
.amik-qr :focus-visible,
.amik-board :focus-visible {
	outline: 2px solid var(--copper-ink, #96502a);
	outline-offset: 2px;
}

/* -------------------------------------------------- app shell */
.amik-portal {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	width: 100%;
	max-width: 1400px;
	min-height: 640px;
	margin: 0 auto;
	background: var(--paper-2);
	border: 1px solid var(--line);
}

.amik-portal__sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 24px 16px;
	background: var(--deep);
	color: var(--paper);
	position: sticky;
	top: 0;
	align-self: start;
	max-height: 100vh;
	overflow-y: auto;
}

.amik-portal__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 8px 16px;
	border-bottom: 1px solid var(--line-dark);
}

.amik-portal__mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--copper);
	color: var(--copper-light);
	font-family: var(--mono);
	font-size: .875rem;
	font-weight: 500;
	letter-spacing: .04em;
	flex: 0 0 auto;
}

.amik-portal__brandtext {
	display: flex;
	flex-direction: column;
	font-size: .875rem;
	font-weight: 500;
	letter-spacing: .16em;
	line-height: 1.2;
	text-transform: uppercase;
}

.amik-portal__brandtext small {
	margin-top: 4px;
	color: var(--steel-light);
	font-family: var(--mono);
	font-size: .625rem;
	font-weight: 400;
	letter-spacing: .2em;
}

.amik-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.amik-nav__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	color: var(--steel-light);
	border-left: 2px solid transparent;
	text-decoration: none;
	font-size: .9375rem;
	line-height: 1.3;
	transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.amik-nav__link:hover,
.amik-nav__link:focus {
	color: var(--paper);
	background: rgba(232, 229, 223, .06);
}

.amik-nav__link.is-active {
	color: var(--paper);
	border-left-color: var(--copper);
	background: rgba(194, 112, 61, .12);
}

.amik-nav__link .amik-icon {
	flex: 0 0 auto;
}

.amik-nav__label {
	flex: 1 1 auto;
}

.amik-nav__badge {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--copper-light);
	color: var(--deep);
	border-radius: 999px;
	font-family: var(--mono);
	font-size: .6875rem;
	font-weight: 500;
}

.amik-portal__user {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: auto;
	padding: 16px 8px 0;
	border-top: 1px solid var(--line-dark);
}

.amik-portal__username {
	color: var(--steel-light);
	font-family: var(--mono);
	font-size: .75rem;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.amik-portal__logout {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--steel-light);
	text-decoration: none;
	font-size: .8125rem;
}

.amik-portal__logout:hover {
	color: var(--copper-light);
}

.amik-portal__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--paper);
}

.amik-portal__topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 24px;
	background: var(--paper-2);
	border-bottom: 1px solid var(--line);
}

.amik-portal__heading {
	min-width: 0;
}

.amik-portal__heading h2 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: -.01em;
	line-height: 1.25;
}

.amik-portal__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.amik-portal__content {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px;
}

.amik-eyebrow {
	margin: 0 0 4px;
	color: var(--steel);
	font-family: var(--mono);
	font-size: .6875rem;
	font-weight: 400;
	letter-spacing: .14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.amik-mono {
	font-family: var(--mono);
	font-size: .8125rem;
	font-variant-numeric: tabular-nums;
}

.amik-hint {
	margin: 6px 0 0;
	color: var(--steel);
	font-size: .8125rem;
	line-height: 1.55;
}

/* -------------------------------------------------- KPI + cards */
.amik-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.amik-kpi {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 16px;
	background: var(--paper-2);
	border: 1px solid var(--line);
}

.amik-kpi__label {
	color: var(--steel);
	font-family: var(--mono);
	font-size: .6875rem;
	letter-spacing: .1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.amik-kpi__value {
	font-family: var(--mono);
	font-size: 1.75rem;
	font-weight: 500;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.amik-kpi__hint {
	color: var(--steel);
	font-size: .75rem;
	line-height: 1.4;
}

.amik-card {
	margin-bottom: 16px;
	padding: 20px;
	background: var(--paper-2);
	border: 1px solid var(--line);
}

.amik-card h2,
.amik-card h3 {
	margin: 0 0 8px;
	font-size: 1.0625rem;
	font-weight: 500;
	letter-spacing: -.005em;
	line-height: 1.3;
}

.amik-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 12px;
}

.amik-card__head h2 {
	margin: 0;
}

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

.amik-grid-2 > .amik-card {
	margin-bottom: 0;
}

.amik-status-line {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 12px;
}

.amik-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 12px 0 0;
}

/* -------------------------------------------------- chart */
.amik-chart {
	margin: 0;
}

.amik-chart__svg {
	display: block;
	width: 100%;
	height: auto;
	color: var(--copper-ink);
	overflow: visible;
}

.amik-chart__svg rect {
	fill: currentColor;
	opacity: .9;
}

.amik-chart__svg rect:hover {
	opacity: 1;
}

.amik-chart__axis {
	stroke: currentColor;
	stroke-width: 1;
	opacity: .22;
}

.amik-chart__caption {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 8px;
	color: var(--steel);
	font-family: var(--mono);
	font-size: .6875rem;
	font-variant-numeric: tabular-nums;
}

.amik-chart__total {
	color: var(--ink);
}
