/* CivMetryx design kit, shared by the nVisionTeK console and every city site.
   Designed, built and managed by nVisionTeK LLC.

   One look for both products: the same colours, type, spacing and frame (a header, a
   rail of sections on the left with a panel beside it, the page, and a tab bar on phones),
   the same sign-in and start-up screens. Each product points --k-accent at its own brand
   colour (Look & Brand in the console, Branding on a city site), so customers keep their
   colours while the layout stays the same everywhere.

   This file is identical in both projects: the console's copy (kit.css) is the original;
   `node scripts/sync-kit.mjs` in the console copies it to manor-wip/src/kit.css. */

:root {
  --k-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --k-accent: var(--brand, #1663d6);
  --k-accent-ink: color-mix(in srgb, var(--k-accent) 78%, #000);
  --k-accent-soft: color-mix(in srgb, var(--k-accent) 10%, #fff);
  --k-on-accent: #fff;
  --k-canvas: #f6f5f1;
  --k-surface: #ffffff;
  --k-sunk: #f1f0eb;
  --k-line: #e3e1da;
  --k-line-2: #eeece6;
  --k-ink: #1c2a2f;
  --k-ink-2: #3c494e;
  --k-muted: #5f6c72;
  --k-good: #0f7a55;
  --k-good-soft: #e7f5ee;
  --k-warn: #94560a;
  --k-warn-soft: #fdf3e2;
  --k-bad: #b42318;
  --k-bad-soft: #fdeceb;
  --k-radius: 12px;
  --k-radius-sm: 8px;
  --btn-radius: 10px;
  --k-shadow: 0 1px 2px rgb(28 42 47 / 6%), 0 8px 24px -12px rgb(28 42 47 / 18%);
  --k-head: 56px;
  --k-rail: 72px;
  --k-panel: 264px;
  --k-tabbar: 60px;
}

/* ---------- the frame: header, rail, panel ---------- */

.k-head {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--k-head);
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--k-line);
  background: var(--k-surface);
  color: var(--k-ink);
  font-family: var(--k-font);
}

.k-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.k-brand:hover {
  text-decoration: none;
}

.k-brand > div:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.k-brand strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-brand span {
  overflow: hidden;
  color: var(--k-muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-ask {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  height: 38px;
  margin: 0 auto;
  padding: 0 12px;
  border: 1px solid var(--k-line);
  border-radius: var(--btn-radius);
  background: var(--k-sunk);
  color: var(--k-muted);
  font: 14px var(--k-font);
  text-align: left;
  cursor: text;
}

.k-ask:hover {
  border-color: color-mix(in srgb, var(--k-accent) 35%, var(--k-line));
}

.k-ask > span {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-ask kbd {
  padding: 0 6px;
  border: 1px solid var(--k-line);
  border-radius: 6px;
  background: var(--k-surface);
  color: var(--k-muted);
  font: 12px/1.6 var(--k-font);
}

.k-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.k-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  overflow-y: auto;
  border-right: 1px solid var(--k-line);
  background: var(--k-sunk);
  font-family: var(--k-font);
}

.k-rail-btn {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 2px 7px;
  border: 0;
  border-radius: var(--btn-radius);
  background: none;
  color: var(--k-muted);
  font: 600 12px/1.1 var(--k-font);
  text-decoration: none;
  cursor: pointer;
}

.k-rail-btn svg {
  width: 21px;
  height: 21px;
}

.k-rail-btn:hover {
  background: color-mix(in srgb, var(--k-ink) 5%, transparent);
  color: var(--k-ink);
  text-decoration: none;
}

.k-rail-btn.on {
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

.k-rail-btn .k-dot {
  position: absolute;
  top: 5px;
  right: 14px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--k-bad);
  color: #fff;
  font: 700 11px/16px var(--k-font);
  text-align: center;
}

.k-rail-gap {
  flex: 1;
}

.k-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--k-line);
  background: var(--k-surface);
  color: var(--k-ink);
  font-family: var(--k-font);
}

.k-panel h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 8px;
  font-size: 16px;
  font-weight: 700;
}

.k-eyebrow {
  margin: 14px 4px 6px;
  color: var(--k-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.k-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: var(--k-radius-sm);
  color: var(--k-ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.k-link:hover {
  background: var(--k-sunk);
  color: var(--k-ink);
  text-decoration: none;
}

.k-link.on {
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
}

.k-link svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.k-link small {
  display: block;
  color: var(--k-muted);
  font-size: 12px;
  font-weight: 500;
}

.k-link .k-n {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--k-bad-soft);
  color: var(--k-bad);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Things that need someone: one card each, coloured by how urgent. */
.k-item {
  display: block;
  margin: 0 0 6px;
  padding: 9px 10px 9px 12px;
  border: 1px solid var(--k-line);
  border-left: 3px solid var(--k-line);
  border-radius: 0 var(--k-radius-sm) var(--k-radius-sm) 0;
  color: var(--k-ink-2);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.k-item:hover {
  background: var(--k-sunk);
  text-decoration: none;
}

.k-item.bad {
  border-left-color: var(--k-bad);
}

.k-item.warn {
  border-left-color: #d39a12;
}

.k-item b {
  color: var(--k-ink);
}

.k-calm {
  display: flex;
  gap: 8px;
  margin: 8px 4px;
  color: var(--k-good);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- small parts ---------- */

.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid var(--k-line);
  border-radius: 999px;
  background: var(--k-surface);
  color: var(--k-ink-2);
  font: 600 13px var(--k-font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.k-chip.on {
  border-color: transparent;
  background: var(--k-accent);
  color: var(--k-on-accent);
}

.k-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--k-accent-soft);
  color: var(--k-accent-ink);
  font: 700 13px var(--k-font);
}

/* ---------- phones: a tab bar along the bottom ---------- */

.k-tabbar {
  display: none;
}

@media (max-width: 760px) {
  .k-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    height: calc(var(--k-tabbar) + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--k-line);
    background: var(--k-surface);
    font-family: var(--k-font);
  }

  .k-tabbar a,
  .k-tabbar button {
    position: relative;
    display: grid;
    flex: 1;
    align-content: center;
    justify-items: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--k-muted);
    font: 600 12px var(--k-font);
    text-decoration: none;
  }

  .k-tabbar svg {
    width: 22px;
    height: 22px;
  }

  .k-tabbar .on {
    color: var(--k-accent-ink);
  }

  .k-tabbar .k-dot {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--k-bad);
    color: #fff;
    font: 700 11px/16px var(--k-font);
  }
}

/* ---------- sign-in and start-up screens ---------- */

.k-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr);
  min-height: 100vh;
  background: var(--k-canvas);
  color: var(--k-ink);
  font-family: var(--k-font);
}

/* The left half: a quiet map with a few projects lighting up, and what this place is for. */
.k-gate-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 48px;
  overflow: hidden;
  border-right: 1px solid var(--k-line);
  background: #f1f0eb;
}

.k-gate-art > svg.k-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.k-gate-art > :not(svg) {
  position: relative;
}

.k-gate-art h2 {
  max-width: 460px;
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.k-gate-art ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--k-ink-2);
  font-size: 15px;
  list-style: none;
}

.k-gate-art li::before {
  content: '✓';
  margin-right: 8px;
  color: var(--k-accent);
  font-weight: 800;
}

.k-gate-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(380px, 100%);
  margin: auto;
  padding: 32px 28px;
}

.k-gate-card h1 {
  margin: 16px 0 4px;
  font-size: 26px;
  font-weight: 800;
}

.k-gate-foot {
  margin-top: 28px;
  color: var(--k-muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .k-gate {
    grid-template-columns: 1fr;
  }

  .k-gate-art {
    display: none;
  }
}

/* The start-up screen: the mark, the name, and a thin line filling while things load. */
.k-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--k-canvas);
  color: var(--k-ink);
  font-family: var(--k-font);
  transition: opacity 0.45s ease;
}

.k-splash.done {
  opacity: 0;
  pointer-events: none;
}

.k-splash-in {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.k-splash-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.k-splash-bar {
  width: 140px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--k-line);
}

.k-splash-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: var(--k-accent);
  animation: k-load 1.1s ease-in-out infinite;
}

@keyframes k-load {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(260%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .k-splash-bar i {
    width: 100%;
    animation: none;
  }
}
