/*
 * Kumia ID pages. The tokens and the kit blocks (k-*) are a copy of the built stylesheet of Kumia Studio, so both read as
 * one product; nothing is imported from the Studio folder. Blocks named a-* are this service's own layout.
 * No script runs on these pages, so every state is a server-rendered one.
 */
:root {
  --k-font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --k-accent: #4338ca; --k-accent-strong: #3730a3; --k-accent-soft: #eef0ff; --k-accent-contrast: #ffffff;
  --k-bg: #f6f7f9; --k-surface: #ffffff; --k-surface-sunken: #f9fafb; --k-border: #e4e7ec; --k-border-strong: #cfd4dc;
  --k-text: #1d2433; --k-text-2: #5d6676; --k-text-3: #98a1b0; --k-hover: #f3f5f8;
  --k-ok-bg: #e7f6ec; --k-ok-text: #1b6b3a; --k-warn-bg: #fdf3dc; --k-warn-text: #8a5a00; --k-bad-bg: #fde8e7; --k-bad-text: #a8261d;
  --k-neutral-bg: #eef1f5; --k-neutral-text: #48566a; --k-info-bg: #e8f1fd; --k-info-text: #1f5aa8;
  --k-radius: 8px; --k-radius-sm: 6px; --k-sidebar: 232px; --k-topbar: 56px; --k-speed: .16s;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--k-font); font-size: 14px; line-height: 1.45; color: var(--k-text); background: var(--k-bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, p, dl, dd, form { margin: 0; }
a { color: var(--k-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
.k-muted { color: var(--k-text-2); }
.k-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.k-icon[data-size="lg"] { width: 20px; height: 20px; }
.k-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* buttons, fields */
.k-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--k-border-strong); border-radius: var(--k-radius-sm); background: var(--k-surface); color: var(--k-text); font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; flex: none; transition: background var(--k-speed), border-color var(--k-speed), transform 80ms; }
.k-btn:hover { background: var(--k-hover); text-decoration: none; }
.k-btn:active { transform: translateY(1px); }
.k-btn[data-variant="primary"] { background: var(--k-accent); border-color: var(--k-accent); color: var(--k-accent-contrast); }
.k-btn[data-variant="primary"]:hover { background: var(--k-accent-strong); border-color: var(--k-accent-strong); }
.k-btn[data-variant="ghost"] { border-color: transparent; background: none; color: var(--k-text-2); }
.k-btn[data-variant="ghost"]:hover { background: var(--k-hover); color: var(--k-text); }
.k-btn[data-variant="danger"] { color: var(--k-bad-text); }
.k-btn[data-size="sm"] { height: 28px; padding: 0 8px; font-size: 13px; }
.k-btn[data-wide="true"] { width: 100%; }
.k-linkbtn { border: 0; background: none; padding: 0; color: var(--k-accent); cursor: pointer; font-weight: 500; }
.k-linkbtn:hover { text-decoration: underline; }
.k-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.k-label { font-size: 13px; font-weight: 500; }
.k-label i { font-style: normal; color: var(--k-bad-text); }
.k-help { font-size: 12px; color: var(--k-text-2); }
.k-error-text { font-size: 12px; color: var(--k-bad-text); }
.k-input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--k-border-strong); border-radius: var(--k-radius-sm); background: var(--k-surface); transition: border-color var(--k-speed), box-shadow var(--k-speed); }
.k-input::placeholder { color: var(--k-text-3); }
.k-input:hover { border-color: var(--k-text-3); }
.k-input:focus { outline: none; border-color: var(--k-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k-accent) 22%, transparent); }
.k-input[aria-invalid="true"] { border-color: var(--k-bad-text); }
.k-input-wrap { position: relative; display: flex; align-items: center; }
.k-input-wrap .k-icon { position: absolute; left: 10px; color: var(--k-text-3); pointer-events: none; }
.k-input-wrap .k-input { padding-left: 34px; }

/* surfaces, pills, people, alerts */
.k-panel { background: var(--k-surface); border: 1px solid var(--k-border); border-radius: var(--k-radius); min-width: 0; }
.k-panel-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.k-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--k-neutral-bg); color: var(--k-neutral-text); max-width: 100%; }
.k-pill[data-tone="ok"] { background: var(--k-ok-bg); color: var(--k-ok-text); }
.k-pill[data-tone="warn"] { background: var(--k-warn-bg); color: var(--k-warn-text); }
.k-pill[data-tone="bad"] { background: var(--k-bad-bg); color: var(--k-bad-text); }
.k-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.k-avatar { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: #6b7a90; text-transform: uppercase; }
.k-person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.k-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--k-radius-sm); font-size: 13px; background: var(--k-info-bg); color: var(--k-info-text); }
.k-alert .k-icon { margin-top: 2px; }
.k-alert[data-tone="bad"] { background: var(--k-bad-bg); color: var(--k-bad-text); }
.k-alert[data-tone="ok"] { background: var(--k-ok-bg); color: var(--k-ok-text); }
.k-alert[data-tone="warn"] { background: var(--k-warn-bg); color: var(--k-warn-text); }
.k-fields { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px 16px; align-items: baseline; }
.k-fields dt { font-size: 13px; color: var(--k-text-2); }
.k-fields dd { min-width: 0; overflow-wrap: anywhere; }
.k-empty { padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--k-text-2); }
.k-empty b { font-weight: 500; color: var(--k-text); }
.k-dash { color: var(--k-text-3); }

/* tables */
.k-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--k-border); min-width: 0; flex-wrap: wrap; }
.k-toolbar-title { font-size: 16px; font-weight: 600; white-space: nowrap; }
.k-count { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--k-text-2); font-variant-numeric: tabular-nums; }
.k-toolbar-search { flex: 0 1 280px; min-width: 160px; }
.k-toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.k-table-scroll { position: relative; overflow: auto; border-radius: 0 0 var(--k-radius) var(--k-radius); }
.k-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.k-table th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 16px; text-align: left; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--k-text-2); background: var(--k-surface-sunken); border-bottom: 1px solid var(--k-border); }
.k-table td { height: 44px; padding: 0 16px; border-bottom: 1px solid var(--k-border); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.k-table tbody tr { transition: background var(--k-speed); }
.k-table tbody tr:hover { background: var(--k-hover); }
.k-table tbody tr:last-child td { border-bottom: 0; }
.k-table td:first-child { font-weight: 500; }
.k-table .k-cell-actions { text-align: right; overflow: visible; max-width: none; }
.k-row-actions { display: inline-flex; gap: 8px; align-items: center; }

/* shell */
.a-shell { display: grid; grid-template-columns: var(--k-sidebar) minmax(0, 1fr); height: 100%; }
.a-side { background: var(--k-surface); border-right: 1px solid var(--k-border); display: flex; flex-direction: column; min-height: 0; }
.k-brand { display: flex; align-items: center; gap: 12px; height: var(--k-topbar); padding: 0 16px; flex: none; color: var(--k-text); }
.k-brand:hover { text-decoration: none; }
.k-brand img { border-radius: 8px; flex: none; }
.k-brand-name { font-weight: 600; font-size: 14px; white-space: nowrap; }
.a-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.k-nav-item { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: var(--k-radius-sm); color: var(--k-text-2); font-weight: 500; white-space: nowrap; transition: background var(--k-speed), color var(--k-speed); }
.k-nav-item:hover { background: var(--k-hover); color: var(--k-text); text-decoration: none; }
.k-nav-item[aria-current="page"] { background: var(--k-accent-soft); color: var(--k-accent-strong); }
.a-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.k-topbar { flex: none; height: var(--k-topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--k-surface); border-bottom: 1px solid var(--k-border); }
.k-topbar-title { font-size: 16px; font-weight: 600; white-space: nowrap; }
.k-topbar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.a-content { flex: 1 1 auto; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.a-read { max-width: 720px; width: 100%; }
.a-head { display: flex; flex-direction: column; gap: 4px; }
.a-h2 { font-size: 16px; font-weight: 600; }
.a-form { display: flex; flex-direction: column; gap: 16px; }
.a-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.a-secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 16px; padding: 12px 16px; border: 1px solid var(--k-border); border-radius: var(--k-radius-sm); background: var(--k-surface-sunken); user-select: all; overflow-wrap: anywhere; }

/* sign-in and the other single-step pages */
.a-auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.a-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 24px; }
.a-brand { display: flex; align-items: center; gap: 12px; }
.a-brand img { border-radius: 10px; }
.a-brand-name { font-size: 16px; font-weight: 600; }
.a-panel { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.a-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.a-sub { color: var(--k-text-2); margin-top: 4px; }
.a-identity { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--k-radius-sm); background: var(--k-surface-sunken); border: 1px solid var(--k-border); font-size: 13px; min-width: 0; }
.a-facts { display: flex; flex-direction: column; gap: 12px; }
.a-fact dt { font-size: 12px; color: var(--k-text-2); }
.a-fact dd { font-weight: 500; overflow-wrap: anywhere; }
.a-fact dd .k-pill { margin-left: 4px; vertical-align: 1px; }
.a-fact-note { display: block; margin-top: 4px; font-weight: 400; }
.a-notes { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--k-text-2); padding: 0 4px; }
.a-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 768 to 1023: the sidebar keeps its icons only (each link keeps its name for assistive tech and as a tooltip). */
@media (min-width: 768px) and (max-width: 1023px) {
  .a-shell { grid-template-columns: 60px minmax(0, 1fr); }
  .a-side .k-brand-name, .a-side .k-nav-text { display: none; }
  .a-side .k-brand { padding: 0; justify-content: center; }
  .a-side .k-nav-item { justify-content: center; padding: 0; }
}
/* Below 768 there is no script to open a drawer, so the navigation becomes one row under nothing else: brand, then links. */
@media (max-width: 767px) {
  .a-shell { display: flex; flex-direction: column; }
  .a-side { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--k-border); overflow-x: auto; flex: none; }
  .a-side .k-brand { height: 48px; padding: 0 8px 0 16px; }
  .a-side .k-brand-name { display: none; }
  /* The row may be wider than a narrow screen: it still scrolls by touch or keyboard focus, without a scrollbar under it. */
  .a-nav { flex-direction: row; padding: 6px 8px; }
  .a-side { scrollbar-width: none; }
  .a-side::-webkit-scrollbar { display: none; }
  .k-topbar { padding: 0 16px; }
  .k-topbar .k-person-name { display: none; }
  .a-content { padding: 16px; }
  .k-fields { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .k-fields dd { margin-bottom: 12px; }
  .k-toolbar-search { flex: 1 1 100%; order: 3; }
}
@media (max-width: 420px) { .a-panel { padding: 16px; } .a-nav .k-nav-item { padding: 0 8px; gap: 8px; } }
