/* CA-Service - Designsystem (hell/dunkel automatisch) */

:root {
	color-scheme: light dark;

	--bg: #f5f6f8;
	--surface: #ffffff;
	--surface-2: #f2f4f7;
	--surface-hover: #f7f8fb;
	--border: #e4e7ec;
	--border-strong: #cfd4dc;
	--text: #101828;
	--text-2: #475467;
	--text-3: #98a2b3;

	--primary: #4f46e5;
	--primary-hover: #4338ca;
	--primary-soft: #eef0ff;
	--primary-text: #ffffff;

	--success: #067647;
	--success-soft: #ecfdf3;
	--warning: #b54708;
	--warning-soft: #fffaeb;
	--danger: #d92d20;
	--danger-hover: #b42318;
	--danger-soft: #fef3f2;
	--neutral-soft: #f2f4f7;

	--radius-lg: 16px;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
	--shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
	--shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);
	--focus: 0 0 0 4px rgba(79, 70, 229, 0.18);

	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0c111d;
		--surface: #131a29;
		--surface-2: #1b2334;
		--surface-hover: #182032;
		--border: #263045;
		--border-strong: #344054;
		--text: #f2f4f7;
		--text-2: #a4adbd;
		--text-3: #6b7588;

		--primary: #7c83ff;
		--primary-hover: #959bff;
		--primary-soft: rgba(124, 131, 255, 0.14);
		--primary-text: #0c111d;

		--success: #47cd89;
		--success-soft: rgba(71, 205, 137, 0.12);
		--warning: #fdb022;
		--warning-soft: rgba(253, 176, 34, 0.12);
		--danger: #f97066;
		--danger-hover: #fda29b;
		--danger-soft: rgba(249, 112, 102, 0.12);
		--neutral-soft: rgba(164, 173, 189, 0.12);

		--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
		--shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
		--shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
		--focus: 0 0 0 4px rgba(124, 131, 255, 0.28);
	}
}

/* ---------- Grundlagen ---------- */

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

html,
body {
	margin: 0;
}

body {
	font: 14px/1.5 var(--font);
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

[hidden] {
	display: none !important;
}

h1,
h2,
h3 {
	margin: 0;
	font-weight: 600;
	letter-spacing: -0.01em;
}

h1 {
	font-size: 22px;
}

h2 {
	font-size: 18px;
}

h3 {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-2);
}

a {
	color: var(--primary);
}

.mono {
	font-family: var(--font-mono);
	font-size: 12.5px;
	word-break: break-all;
}

.muted {
	color: var(--text-2);
}

.subtle {
	color: var(--text-3);
}

.icon {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sm {
	width: 15px;
	height: 15px;
}

.icon-lg {
	width: 28px;
	height: 28px;
}

/* ---------- Knoepfe ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 38px;
	padding: 0 14px;
	font: 500 14px/1 var(--font);
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
	background: var(--surface-hover);
}

.btn:focus-visible,
.input:focus,
.select:focus,
.icon-btn:focus-visible,
.info:focus-visible {
	outline: none;
	box-shadow: var(--focus);
	border-color: var(--primary);
}

.btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.btn-primary {
	color: var(--primary-text);
	background: var(--primary);
	border-color: var(--primary);
}

.btn-primary:hover {
	background: var(--primary-hover);
	border-color: var(--primary-hover);
}

.btn-danger {
	color: #fff;
	background: var(--danger);
	border-color: var(--danger);
}

.btn-danger:hover {
	background: var(--danger-hover);
	border-color: var(--danger-hover);
}

.btn-danger-ghost {
	color: var(--danger);
	border-color: var(--border-strong);
}

.btn-danger-ghost:hover {
	background: var(--danger-soft);
}

.btn-ghost {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
}

.btn-ghost:hover {
	background: var(--surface-2);
}

.btn-sm {
	height: 32px;
	padding: 0 10px;
	font-size: 13px;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--text-2);
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.icon-btn:hover {
	color: var(--text);
	background: var(--surface-2);
}

/* ---------- Info-Knopf und Hilfe-Popover ---------- */

.info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-left: 4px;
	padding: 0;
	color: var(--text-3);
	background: transparent;
	border: none;
	border-radius: 50%;
	cursor: help;
	vertical-align: middle;
}

.info:hover {
	color: var(--primary);
}

.info .icon {
	width: 16px;
	height: 16px;
}

.help-popover {
	position: fixed;
	inset: auto;
	margin: 0;
	max-width: 320px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

/* ---------- Formularelemente ---------- */

.input,
.select,
textarea.input {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	font: 14px var(--font);
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-sm);
	transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input {
	height: auto;
	min-height: 64px;
	padding: 10px 12px;
	resize: vertical;
}

.select {
	width: auto;
	padding-right: 32px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.field-label {
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	color: var(--text);
}

.field-optional {
	margin-left: 6px;
	font-weight: 400;
	color: var(--text-3);
}

.field-hint {
	font-size: 12.5px;
	color: var(--text-3);
}

.field-hint.ok {
	color: var(--success);
}

.field-hint.bad {
	color: var(--danger);
}

.input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.input-group .input {
	padding-right: 44px;
}

.input-group .icon-btn {
	position: absolute;
	right: 3px;
}

.search {
	position: relative;
	flex: 1;
	min-width: 220px;
	max-width: 420px;
}

.search > .icon {
	position: absolute;
	top: 11px;
	left: 12px;
	color: var(--text-3);
	pointer-events: none;
}

.search .input {
	padding-left: 38px;
	padding-right: 38px;
}

.search .icon-btn {
	position: absolute;
	top: 3px;
	right: 3px;
}

/* Schalter (Checkbox als Toggle) */
.switch {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: var(--text);
	cursor: pointer;
	user-select: none;
}

.switch input {
	appearance: none;
	position: relative;
	width: 36px;
	height: 20px;
	margin: 0;
	background: var(--border-strong);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s;
}

.switch input::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s;
}

.switch input:checked {
	background: var(--primary);
}

.switch input:checked::after {
	transform: translateX(16px);
}

.switch input:focus-visible {
	outline: none;
	box-shadow: var(--focus);
}

input[type="checkbox"].check {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--primary);
	cursor: pointer;
}

/* ---------- Kopfleiste ---------- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 16px;
	height: 64px;
	padding: 0 28px;
	background: color-mix(in srgb, var(--surface) 85%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 15px;
}

.brand-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: #fff;
	background: linear-gradient(135deg, #6366f1, #4338ca);
	border-radius: 9px;
	box-shadow: var(--shadow-sm);
}

.brand-mark .icon {
	width: 18px;
	height: 18px;
}

.brand-ca {
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
	color: var(--text-2);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
}

.topbar-spacer {
	flex: 1;
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 36px;
	height: 36px;
	font-size: 13px;
	font-weight: 600;
	color: var(--primary);
	background: var(--primary-soft);
	border-radius: 50%;
}

.avatar-lg {
	width: 48px;
	height: 48px;
	font-size: 16px;
}

button.avatar {
	border: none;
	cursor: pointer;
}

button.avatar:focus-visible {
	outline: none;
	box-shadow: var(--focus);
}

/* ---------- Menues (Popover) ---------- */

.menu {
	position: fixed;
	inset: auto;
	margin: 0;
	min-width: 240px;
	padding: 6px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

.menu-header {
	padding: 8px 10px 10px;
	margin-bottom: 4px;
	font-size: 13px;
	color: var(--text-2);
	border-bottom: 1px solid var(--border);
}

.menu-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 9px 10px;
	font: 14px var(--font);
	color: var(--text);
	text-align: left;
	background: transparent;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
	outline: none;
	background: var(--surface-2);
}

.menu-item .icon {
	margin-top: 1px;
	color: var(--text-2);
}

.menu-item small {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--text-3);
}

.menu-item.danger,
.menu-item.danger .icon {
	color: var(--danger);
}

/* ---------- Seite ---------- */

.page {
	max-width: 1240px;
	margin: 0 auto;
	padding: 28px;
}

.page-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.page-header p {
	margin: 4px 0 0;
	color: var(--text-2);
}

/* Kacheln */
.kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.kpi {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	text-align: left;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.kpi:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow);
}

.kpi.is-active {
	border-color: var(--primary);
	box-shadow: var(--focus);
}

.kpi-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text-2);
}

.kpi-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.kpi-value {
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.kpi-active .kpi-dot {
	background: var(--success);
}

.kpi-expiring .kpi-dot {
	background: var(--warning);
}

.kpi-revoked .kpi-dot {
	background: var(--danger);
}

.kpi-expired .kpi-dot {
	background: var(--text-3);
}

.kpi .info {
	position: absolute;
	top: 14px;
	right: 14px;
}

/* Karte mit Tabelle */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.filterbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 6px 0 12px;
	font-size: 13px;
	color: var(--primary);
	background: var(--primary-soft);
	border-radius: 999px;
}

.filter-chip .icon-btn {
	width: 22px;
	height: 22px;
	color: var(--primary);
}

.filter-spacer {
	flex: 1;
}

.table-wrap {
	overflow-x: auto;
}

table.list {
	width: 100%;
	border-collapse: collapse;
}

table.list th {
	padding: 10px 16px;
	font-size: 12px;
	font-weight: 500;
	color: var(--text-2);
	text-align: left;
	white-space: nowrap;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
}

table.list th.sortable {
	cursor: pointer;
	user-select: none;
}

table.list th.sortable:hover {
	color: var(--text);
}

table.list th .sort-indicator {
	display: inline-block;
	width: 12px;
	margin-left: 4px;
	color: var(--primary);
}

table.list td {
	padding: 12px 16px;
	vertical-align: middle;
	border-bottom: 1px solid var(--border);
}

table.list tbody tr {
	cursor: pointer;
	transition: background 0.1s;
}

table.list tbody tr:hover {
	background: var(--surface-hover);
}

table.list tbody tr.is-current {
	background: var(--primary-soft);
}

table.list tbody tr.is-hidden-row td {
	opacity: 0.6;
}

table.list tbody tr:last-child td {
	border-bottom: none;
}

.col-check {
	width: 44px;
	padding-right: 0 !important;
}

.cell-person {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 220px;
}

.cell-person strong {
	display: block;
	font-weight: 600;
}

.cell-sub {
	display: block;
	font-size: 13px;
	color: var(--text-2);
}

.cell-date {
	white-space: nowrap;
}

.cell-date .cell-sub.warn {
	color: var(--warning);
}

/* Status-Pillen und Etiketten */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 24px;
	padding: 0 10px;
	font-size: 12.5px;
	font-weight: 500;
	white-space: nowrap;
	border-radius: 999px;
}

.pill::before {
	content: "";
	width: 6px;
	height: 6px;
	background: currentColor;
	border-radius: 50%;
}

.pill-active {
	color: var(--success);
	background: var(--success-soft);
}

.pill-expiring {
	color: var(--warning);
	background: var(--warning-soft);
}

.pill-revoked {
	color: var(--danger);
	background: var(--danger-soft);
}

.pill-expired {
	color: var(--text-2);
	background: var(--neutral-soft);
}

.badge {
	display: inline-flex;
	align-items: center;
	height: 20px;
	margin-left: 6px;
	padding: 0 7px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--primary);
	background: var(--primary-soft);
	border-radius: 6px;
	vertical-align: middle;
}

.badge-muted {
	color: var(--text-2);
	background: var(--neutral-soft);
}

/* Leerzustand */
.empty {
	padding: 56px 24px;
	text-align: center;
	cursor: default;
}

.empty .icon-lg {
	color: var(--text-3);
}

.empty h2 {
	margin: 12px 0 4px;
	font-size: 16px;
}

.empty p {
	margin: 0 0 16px;
	color: var(--text-2);
}

table.list tbody tr.empty-row,
table.list tbody tr.empty-row:hover {
	background: transparent;
	cursor: default;
}

/* Blaettern */
.pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	font-size: 13px;
	color: var(--text-2);
	border-top: 1px solid var(--border);
}

.pager-buttons {
	display: flex;
	gap: 8px;
}

/* Schwebende Auswahl-Leiste */
.bulkbar {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 8px 8px 18px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow-lg);
	transform: translateX(-50%);
}

.bulkbar-count {
	font-weight: 600;
	margin-right: 6px;
}

/* ---------- Dialoge ---------- */

dialog {
	padding: 0;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-lg);
}

dialog::backdrop {
	background: rgba(16, 24, 40, 0.45);
	backdrop-filter: blur(2px);
}

/* Zentriertes Modal */
dialog.modal {
	width: min(640px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	border-radius: var(--radius-lg);
}

dialog.modal-sm {
	width: min(440px, calc(100vw - 32px));
}

.modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 24px 4px;
}

.modal-header p {
	margin: 4px 0 0;
	color: var(--text-2);
}

.modal-body {
	padding: 16px 24px;
	overflow-y: auto;
}

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px 22px;
}

.form-section {
	padding: 18px 0;
	border-top: 1px solid var(--border);
}

.form-section:first-child {
	padding-top: 6px;
	border-top: none;
}

.form-section > h3 {
	display: flex;
	align-items: center;
	margin-bottom: 14px;
}

.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.form-grid .span-2 {
	grid-column: span 2;
}

.form-error {
	padding: 10px 12px;
	margin-top: 12px;
	font-size: 13px;
	color: var(--danger);
	background: var(--danger-soft);
	border-radius: var(--radius-sm);
}

.success-state {
	padding: 36px 24px 12px;
	text-align: center;
}

.success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	color: var(--success);
	background: var(--success-soft);
	border-radius: 50%;
}

.success-state h2 {
	margin: 16px 0 6px;
}

.success-state p {
	margin: 0 auto 8px;
	max-width: 440px;
	color: var(--text-2);
}

.callout {
	display: flex;
	gap: 10px;
	padding: 12px 14px;
	margin-top: 16px;
	font-size: 13px;
	text-align: left;
	color: var(--text);
	background: var(--warning-soft);
	border-radius: var(--radius-sm);
}

.callout .icon {
	color: var(--warning);
}

/* Seitenpanel rechts */
dialog.drawer {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(520px, 100vw);
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	border: none;
	border-left: 1px solid var(--border);
	border-radius: 0;
	animation: drawer-in 0.22s ease-out;
}

dialog.drawer::backdrop {
	background: rgba(16, 24, 40, 0.25);
	backdrop-filter: none;
}

@keyframes drawer-in {
	from {
		transform: translateX(40px);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.drawer-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.drawer-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 22px 22px 18px;
	border-bottom: 1px solid var(--border);
}

.drawer-title {
	flex: 1;
	min-width: 0;
}

.drawer-title h2 {
	overflow-wrap: anywhere;
}

.drawer-title .muted {
	margin: 2px 0 10px;
}

.drawer-body {
	flex: 1;
	padding: 6px 22px 22px;
	overflow-y: auto;
}

.drawer-section {
	padding: 18px 0;
	border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
	border-bottom: none;
}

.drawer-section > h3 {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
}

.kv {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 10px 14px;
	margin: 0;
	font-size: 14px;
}

.kv dt {
	display: flex;
	align-items: center;
	color: var(--text-2);
}

.kv dd {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
	min-width: 0;
}

.kv dd > span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.drawer-footer {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	background: var(--surface);
	border-top: 1px solid var(--border);
}

.drawer-footer .spacer {
	flex: 1;
}

/* Sperr-Bestaetigung im Panel */
.revoke-card {
	padding: 16px;
	margin: 0 22px 14px;
	background: var(--danger-soft);
	border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
	border-radius: var(--radius);
}

.revoke-card h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	color: var(--danger);
	text-transform: none;
	letter-spacing: 0;
	font-size: 15px;
}

.revoke-card p {
	margin: 0 0 12px;
	color: var(--text-2);
	font-size: 13px;
}

.reason-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.reason {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.reason:has(input:checked) {
	border-color: var(--danger);
}

.reason input {
	margin-top: 3px;
	accent-color: var(--danger);
}

.reason strong {
	display: block;
	font-weight: 500;
}

.reason small {
	display: block;
	font-size: 12.5px;
	color: var(--text-2);
}

.revoke-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

/* Zeitleiste */
.timeline {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.timeline li {
	position: relative;
	padding: 0 0 14px 24px;
}

.timeline li::before {
	content: "";
	position: absolute;
	top: 6px;
	left: 4px;
	width: 9px;
	height: 9px;
	background: var(--surface);
	border: 2px solid var(--border-strong);
	border-radius: 50%;
}

.timeline li::after {
	content: "";
	position: absolute;
	top: 18px;
	bottom: 0;
	left: 9px;
	width: 1px;
	background: var(--border);
}

.timeline li:last-child::after {
	display: none;
}

.timeline li.is-current::before {
	background: var(--primary);
	border-color: var(--primary);
}

.timeline button {
	padding: 0;
	font: inherit;
	color: var(--primary);
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
}

.timeline button:hover {
	text-decoration: underline;
}

.timeline .subtle {
	display: block;
	font-size: 12.5px;
}

details.audit summary {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-2);
	cursor: pointer;
	list-style: none;
}

details.audit summary::-webkit-details-marker {
	display: none;
}

details.audit summary .icon {
	transition: transform 0.15s;
}

details.audit[open] summary .icon {
	transform: rotate(90deg);
}

details.audit ul {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
}

details.audit li {
	padding: 6px 0;
	border-bottom: 1px dashed var(--border);
}

details.audit li:last-child {
	border-bottom: none;
}

/* ---------- Toasts ---------- */

.toasts {
	position: fixed;
	inset: auto 24px 24px auto;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 420px;
	background: transparent;
	border: none;
	overflow: visible;
}

.toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	font-size: 14px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	animation: toast-in 0.2s ease-out;
}

.toast-ok .icon {
	color: var(--success);
}

.toast-error .icon {
	color: var(--danger);
}

.toast-info .icon {
	color: var(--primary);
}

@keyframes toast-in {
	from {
		transform: translateY(8px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* ---------- Login ---------- */

.login-page {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 24px;
	background:
		radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
		radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
		var(--bg);
}

.login-card {
	width: min(420px, 100%);
	padding: 32px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}

.login-card .brand {
	margin-bottom: 24px;
}

.login-card h1 {
	margin-bottom: 4px;
}

.login-card > p {
	margin: 0 0 20px;
	color: var(--text-2);
}

.login-card form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.login-card .btn {
	width: 100%;
	height: 42px;
}

.cert-status {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	margin-bottom: 20px;
	font-size: 13px;
	border-radius: var(--radius-sm);
}

.cert-status.ok {
	color: var(--success);
	background: var(--success-soft);
}

.cert-status.bad {
	color: var(--danger);
	background: var(--danger-soft);
}

.cert-status span {
	flex: 1;
	color: var(--text);
}

/* ---------- Selbst-Erneuerung (renew.html) ---------- */

.login-card .kv {
	margin-bottom: 20px;
	grid-template-columns: 110px 1fr;
}

.login-card .btn.btn-sm {
	width: auto;
	height: 32px;
}

.login-card h3 {
	display: flex;
	align-items: center;
	margin: 4px 0 10px;
}

.steps {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 16px;
	padding-left: 20px;
	font-size: 13px;
	color: var(--text-2);
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 900px) {
	.kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.page {
		padding: 20px 16px;
	}

	.topbar {
		padding: 0 16px;
	}

	.brand-ca {
		display: none;
	}

	.form-grid {
		grid-template-columns: 1fr;
	}

	.form-grid .span-2 {
		grid-column: auto;
	}
}

.sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Hinweis-Banner (z.B. eigenes Admin-Zertifikat laeuft ab) */
.banner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px 12px 16px;
	margin-bottom: 20px;
	color: var(--text);
	background: var(--warning-soft);
	border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
	border-radius: var(--radius);
}

.banner > .icon {
	color: var(--warning);
}

.banner > span {
	flex: 1;
}

/* Navigation in der Kopfleiste */
.nav {
	display: flex;
	gap: 4px;
	margin-left: 20px;
}

.nav a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 36px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 500;
	color: var(--text-2);
	text-decoration: none;
	border-radius: var(--radius-sm);
	transition: background 0.15s, color 0.15s;
}

.nav a:hover {
	color: var(--text);
	background: var(--surface-2);
}

.nav a.is-active {
	color: var(--primary);
	background: var(--primary-soft);
}

.nav a:focus-visible {
	outline: none;
	box-shadow: var(--focus);
}

.page-header h1 {
	display: flex;
	align-items: center;
}

.col-actions {
	width: 56px;
	text-align: right !important;
}

table.list-compact td {
	padding-top: 9px;
	padding-bottom: 9px;
	font-size: 13.5px;
}

table.list-compact tbody tr {
	cursor: default;
}

.cell-details {
	max-width: 340px;
	color: var(--text-2);
}

.pill-muted {
	color: var(--text-2);
	background: var(--neutral-soft);
}

.pill-info {
	color: var(--primary);
	background: var(--primary-soft);
}

.pill + .pill {
	margin-left: 6px;
}

@media (max-width: 900px) {
	.nav a span,
	.nav a {
		padding: 0 8px;
	}

	.nav {
		margin-left: 4px;
	}
}

.link-button {
	padding: 0;
	font: inherit;
	color: var(--primary);
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
}

.link-button:hover {
	text-decoration: underline;
}

/* Einstellungen */
.settings-card {
	margin-bottom: 20px;
}

.card-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--border);
}

.card-header > div {
	flex: 1;
}

.card-header h2 {
	display: flex;
	align-items: center;
	font-size: 16px;
}

.card-header p {
	margin: 2px 0 0;
	font-size: 13.5px;
}

.card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--primary);
	background: var(--primary-soft);
	border-radius: 10px;
}

.card-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
}

.card-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-top: 4px;
}

.form-grid-tight {
	gap: 12px;
}

.input-inline {
	width: 240px;
}

.input-file {
	height: auto;
	padding: 7px 10px;
}

.settings-switches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
}

.settings-switches .switch + .info {
	margin-right: 18px;
}

.preview {
	padding: 14px 16px;
	font-size: 13.5px;
	background: var(--surface-2);
	border-radius: var(--radius-sm);
}

.preview h4 {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
}

.preview ul {
	margin: 0 0 12px;
	padding-left: 18px;
}

.preview ul:last-child {
	margin-bottom: 0;
}
