/* ==========================================================================
   Linked Housing Portal - design system
   Brand: "The Compassionate Shelter". Muted ocean blue, soft mint, dusty
   periwinkle, layered translucent shields. Tone: gentle, protective, human
   centred, restorative.
   Heading font should be Ansam. It is not available on any web font service
   and we do not have the file, so Inter carries everything for now.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..800;1,14..32,300..800&display=swap');

:root {
  /* ---- brand ----------------------------------------------------------- */
  --lh-primary:     #578CB0;
  --lh-primary-600: #46748F;
  --lh-primary-700: #365A70;
  --lh-primary-100: #E7F0F6;
  --lh-primary-050: #F2F8FB;

  --lh-mint:        #A9D9D9;
  --lh-mint-600:    #3F8A8A;
  --lh-mint-100:    #E8F6F6;

  --lh-peri:        #929DC6;
  --lh-peri-600:    #6270A5;
  --lh-peri-100:    #EEF0F8;

  --lh-shield:      #A4CAD5;

  /* ---- surfaces -------------------------------------------------------- */
  --lh-sand:      #F4F7FA;
  --lh-sand-2:    #E9F0F5;
  --lh-card:      #FFFFFF;
  --lh-nav:       #1F3B52;
  --lh-nav-2:     #2B4F6B;
  --lh-nav-line:  #33597A;

  /* ---- ink ------------------------------------------------------------- */
  --lh-ink:       #17242E;
  --lh-ink-2:     #526575;
  --lh-ink-3:     #8797A5;
  --lh-line:      #DEE7ED;
  --lh-line-2:    #EEF3F7;

  /* legacy aliases kept so older rules keep resolving */
  --lh-green:     var(--lh-primary);
  --lh-green-600: var(--lh-primary-600);
  --lh-green-100: var(--lh-primary-100);
  --lh-blue:      var(--lh-peri-600);
  --lh-blue-100:  var(--lh-peri-100);

  /* ---- status ---------------------------------------------------------- */
  --lh-ok:        #2E7D68;
  --lh-ok-100:    #E3F2ED;
  --lh-amber:     #8A6113;
  --lh-amber-100: #F8EFDA;
  --lh-red:       #A2453F;
  --lh-red-100:   #F8E8E6;
  --lh-teal:      #35807F;
  --lh-teal-100:  var(--lh-mint-100);
  --lh-violet:    var(--lh-peri-600);
  --lh-violet-100:var(--lh-peri-100);

  /* ---- radii, concentric: outer = inner + padding ---------------------- */
  --r-xl:   18px;
  --r-lg:   12px;
  --r-md:   10px;
  --r-sm:   8px;
  --r-pill: 999px;

  --lh-r-lg: var(--r-xl);
  --lh-r-md: var(--r-lg);
  --lh-r-sm: var(--r-md);

  /* ---- elevation: layered and transparent ------------------------------ */
  --sh-1: 0 1px 1px rgba(23, 36, 46, .03),
          0 1px 2px rgba(23, 36, 46, .04);
  --sh-2: 0 1px 2px rgba(23, 36, 46, .04),
          0 4px 10px -3px rgba(23, 36, 46, .06),
          0 14px 28px -12px rgba(23, 36, 46, .09);
  --sh-3: 0 2px 4px rgba(23, 36, 46, .05),
          0 10px 24px -6px rgba(23, 36, 46, .10),
          0 32px 64px -24px rgba(23, 36, 46, .20);

  --lh-shadow:    var(--sh-1);
  --lh-shadow-lg: var(--sh-3);

  /* ---- motion ---------------------------------------------------------- */
  --ease:  cubic-bezier(.2, 0, 0, 1);
  --fast:  .14s;
  --med:   .22s;
  --slow:  .34s;

  --lh-sidebar: 258px;
  --lh-topbar: 66px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--lh-sand);
  color: var(--lh-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 680;
  letter-spacing: -0.018em;
  text-wrap: balance;
  color: var(--lh-ink);
}
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { flex: 0 0 auto; }

:focus-visible {
  outline: 2px solid var(--lh-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.lh-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lh-skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--lh-card); color: var(--lh-ink);
  padding: 10px 16px; border-radius: var(--r-md);
  z-index: 200; box-shadow: var(--sh-3);
  transition: top var(--fast) var(--ease); font-weight: 620;
}
.lh-skip:focus { top: 12px; }

/* ============================================================ app shell === */

.lh-app { display: grid; grid-template-columns: var(--lh-sidebar) 1fr; min-height: 100vh; }

/* ------------------------------------------------------------- sidebar --- */

.lh-side {
  background: var(--lh-nav);
  background-image:
    radial-gradient(120% 60% at 0% 0%, rgba(169, 217, 217, .10), transparent 60%),
    radial-gradient(100% 50% at 100% 100%, rgba(146, 157, 198, .12), transparent 60%);
  color: #D3E2EC;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lh-nav-line) transparent;
}
.lh-side::-webkit-scrollbar { width: 8px; }
.lh-side::-webkit-scrollbar-thumb { background: var(--lh-nav-line); border-radius: 8px; }
.lh-side::-webkit-scrollbar-track { background: transparent; }

.lh-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.lh-brand img { width: 100%; max-width: 184px; height: auto; display: block; }

.lh-nav { padding: 12px 12px 26px; flex: 1; }

.lh-nav__group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: #7FA4BE;
  padding: 18px 10px 7px;
}
.lh-nav__group:first-child { padding-top: 6px; }

.lh-nav__item {
  display: flex; align-items: center; gap: 11px;
  min-height: 38px; padding: 8px 10px;
  border-radius: var(--r-md);
  color: #C1D6E4; font-size: 13.5px; font-weight: 500;
  cursor: pointer; position: relative;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lh-nav__item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lh-nav__item:active { background: rgba(255, 255, 255, .11); }
.lh-nav__item.is-active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 620; }
.lh-nav__item.is-active::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--lh-mint);
}
.lh-nav__item svg { opacity: .78; transition: opacity var(--fast) var(--ease); }
.lh-nav__item:hover svg, .lh-nav__item.is-active svg { opacity: 1; }
.lh-nav__label { flex: 1; min-width: 0; }

.lh-nav__count {
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: rgba(255, 255, 255, .14); color: #DCEAF4;
  border-radius: var(--r-pill); padding: 2px 7px; min-width: 20px; text-align: center;
}
.lh-nav__count--alert { background: #8E4139; color: #FCE9E6; }

.lh-side__foot {
  padding: 16px 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  position: relative; overflow: hidden;
}
.lh-side__foot::after {
  content: ''; position: absolute; right: -18px; bottom: -14px;
  width: 92px; height: 92px; opacity: .10; pointer-events: none;
  background: url('brand/emblem.svg') no-repeat center / contain;
}
.lh-side__note { font-size: 11.5px; line-height: 1.5; color: #85A8C2; position: relative; }

/* -------------------------------------------------------------- topbar --- */

.lh-main { min-width: 0; display: flex; flex-direction: column; }

.lh-top {
  height: var(--lh-topbar);
  background: rgba(244, 247, 250, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--lh-line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 40;
}

.lh-burger {
  display: none; width: 40px; height: 40px;
  border: 1px solid var(--lh-line); background: var(--lh-card);
  border-radius: var(--r-md); cursor: pointer;
  place-items: center; color: var(--lh-ink);
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.lh-burger:active { transform: scale(.96); }

.lh-search { flex: 1; max-width: 380px; position: relative; }
.lh-search input {
  width: 100%; height: 38px;
  border: 1px solid var(--lh-line);
  background: var(--lh-card);
  border-radius: var(--r-pill);
  padding: 0 16px 0 38px;
  font: inherit; font-size: 13.5px; color: var(--lh-ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.lh-search input::placeholder { color: var(--lh-ink-3); }
.lh-search input:hover { border-color: #CBD9E3; }
.lh-search input:focus {
  outline: none; border-color: var(--lh-primary);
  box-shadow: 0 0 0 3px rgba(87, 140, 176, .16);
}
.lh-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--lh-ink-3); pointer-events: none;
}

.lh-top__spacer { flex: 1; }

.lh-iconbtn {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  border: 1px solid var(--lh-line); background: var(--lh-card);
  display: grid; place-items: center;
  cursor: pointer; color: var(--lh-ink-2); position: relative;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.lh-iconbtn:hover { background: var(--lh-sand-2); color: var(--lh-ink); border-color: #CBD9E3; }
.lh-iconbtn:active { transform: scale(.96); }
.lh-iconbtn__dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: var(--r-pill);
  background: var(--lh-red); border: 2px solid var(--lh-card);
}

.lh-user {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 4px 14px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--lh-line); background: var(--lh-card);
  cursor: pointer; text-align: left;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.lh-user:hover { background: var(--lh-sand-2); border-color: #CBD9E3; }
.lh-user:active { transform: scale(.98); }
.lh-user__name { font-size: 13px; font-weight: 620; line-height: 1.25; display: block; }
.lh-user__role { font-size: 11.5px; color: var(--lh-ink-3); line-height: 1.25; display: block; }

.lh-avatar {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--lh-primary-100); color: var(--lh-primary-700);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 720; letter-spacing: .02em;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(23, 36, 46, .04);
}
.lh-avatar--lg { width: 46px; height: 46px; font-size: 15px; }
.lh-avatar--blue   { background: var(--lh-peri-100); color: var(--lh-peri-600); }
.lh-avatar--amber  { background: var(--lh-amber-100); color: var(--lh-amber); }
.lh-avatar--violet { background: var(--lh-mint-100); color: var(--lh-mint-600); }

.lh-roleswitch {
  display: flex; gap: 2px;
  background: var(--lh-sand-2);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-pill); padding: 3px;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.lh-roleswitch::-webkit-scrollbar { display: none; }
.lh-roleswitch button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; color: var(--lh-ink-2);
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.lh-roleswitch button:hover { color: var(--lh-ink); }
.lh-roleswitch button.is-on {
  background: var(--lh-card); color: var(--lh-primary-700); font-weight: 680;
  box-shadow: var(--sh-1);
}

/* ------------------------------------------------------------ page body -- */

.lh-view { padding: 26px 26px 64px; flex: 1; position: relative; }

/* layered translucent wash, taken from the logo's shield idea */
.lh-view::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 260px;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(90% 100% at 88% -30%, rgba(169, 217, 217, .30), transparent 62%),
    radial-gradient(70% 90% at 12% -40%, rgba(146, 157, 198, .18), transparent 60%);
}
.lh-view > * { position: relative; z-index: 1; }

/* staggered entrance, indexed by app.js */
@media (prefers-reduced-motion: no-preference) {
  .lh-view > .lh-enter {
    animation: lh-rise var(--slow) var(--ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
}
@keyframes lh-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.lh-pagehead {
  display: flex; align-items: flex-start; gap: 18px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.lh-pagehead__text { flex: 1; min-width: 260px; }
.lh-pagehead h1 { font-size: 25px; line-height: 1.18; letter-spacing: -0.025em; font-weight: 700; }
.lh-pagehead p {
  color: var(--lh-ink-2); font-size: 14px; margin-top: 7px; max-width: 74ch; line-height: 1.6;
}
.lh-pagehead__actions { display: flex; gap: 9px; flex-wrap: wrap; }

.lh-crumbs {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--lh-ink-3); margin-bottom: 10px;
}
.lh-crumbs a { color: var(--lh-primary-600); font-weight: 600; }
.lh-crumbs a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------- buttons --- */

.lh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 620; letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.lh-btn:active { transform: scale(.96); }

.lh-btn--primary {
  background: var(--lh-primary); color: #fff;
  box-shadow: 0 1px 2px rgba(23, 36, 46, .10), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.lh-btn--primary:hover { background: var(--lh-primary-600); }
.lh-btn--ghost { background: var(--lh-card); color: var(--lh-ink); border-color: var(--lh-line); box-shadow: var(--sh-1); }
.lh-btn--ghost:hover { background: var(--lh-sand-2); border-color: #CBD9E3; }
.lh-btn--quiet { background: transparent; color: var(--lh-ink-2); }
.lh-btn--quiet:hover { background: var(--lh-sand-2); color: var(--lh-ink); }
.lh-btn--danger { background: var(--lh-red-100); color: var(--lh-red); border-color: #EFD6D3; }
.lh-btn--danger:hover { background: #F3DDDA; }
.lh-btn--sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.lh-btn--block { width: 100%; }

/* --------------------------------------------------------------- cards --- */

.lh-card {
  background: var(--lh-card);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  transition: box-shadow var(--med) var(--ease), border-color var(--med) var(--ease);
}
.lh-card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 15px;
  border-bottom: 1px solid var(--lh-line-2);
}
.lh-card__head h2, .lh-card__head h3 { font-size: 15px; letter-spacing: -0.012em; font-weight: 660; }
.lh-card__head p { font-size: 12.5px; color: var(--lh-ink-3); margin-top: 3px; line-height: 1.45; }
.lh-card__head .lh-spacer { flex: 1; }
.lh-card__body { padding: 20px; }
.lh-card__body--flush { padding: 0; }
.lh-card__foot {
  padding: 13px 20px; border-top: 1px solid var(--lh-line-2);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--lh-ink-2);
  background: var(--lh-primary-050);
  border-radius: 0 0 calc(var(--r-xl) - 1px) calc(var(--r-xl) - 1px);
}

.lh-grid { display: grid; gap: 16px; }
.lh-grid--kpi  { grid-template-columns: repeat(auto-fit, minmax(min(208px, 100%), 1fr)); }
.lh-grid--2    { grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.lh-grid--3    { grid-template-columns: repeat(auto-fit, minmax(min(258px, 100%), 1fr)); }
.lh-grid--cards{ grid-template-columns: repeat(auto-fill, minmax(min(298px, 100%), 1fr)); }
.lh-split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.lh-stack { display: grid; gap: 16px; }

/* ----------------------------------------------------------------- kpi --- */

.lh-kpi {
  background: var(--lh-card);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-xl);
  padding: 16px 18px 17px;
  box-shadow: var(--sh-1);
  position: relative; overflow: hidden;
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
}
.lh-kpi::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 100% 0%, rgba(169, 217, 217, .16), transparent 55%);
}
.lh-kpi:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.lh-kpi__top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; position: relative; }
.lh-kpi__icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--lh-primary-100); color: var(--lh-primary-700);
}
.lh-kpi__icon--blue   { background: var(--lh-peri-100);   color: var(--lh-peri-600); }
.lh-kpi__icon--amber  { background: var(--lh-amber-100);  color: var(--lh-amber); }
.lh-kpi__icon--red    { background: var(--lh-red-100);    color: var(--lh-red); }
.lh-kpi__icon--violet { background: var(--lh-peri-100);   color: var(--lh-peri-600); }
.lh-kpi__icon--teal   { background: var(--lh-mint-100);   color: var(--lh-mint-600); }
.lh-kpi__label { font-size: 12.5px; font-weight: 620; color: var(--lh-ink-2); }
.lh-kpi__value {
  font-size: 29px; font-weight: 720; letter-spacing: -0.035em; line-height: 1.05;
  font-variant-numeric: tabular-nums; position: relative;
}
.lh-kpi__value small { font-size: 16px; font-weight: 660; color: var(--lh-ink-3); letter-spacing: -0.01em; }
.lh-kpi__meta {
  margin-top: 8px; font-size: 12.5px; color: var(--lh-ink-3);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative;
}
.lh-kpi__delta { font-weight: 680; }
.lh-kpi__delta--up   { color: var(--lh-ok); }
.lh-kpi__delta--down { color: var(--lh-red); }

/* -------------------------------------------------------------- badges --- */

.lh-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 640; white-space: nowrap;
  letter-spacing: -0.003em;
  background: var(--lh-sand-2); color: var(--lh-ink-2);
  box-shadow: inset 0 0 0 1px rgba(23, 36, 46, .04);
}
.lh-badge--green  { background: var(--lh-ok-100);     color: var(--lh-ok); }
.lh-badge--blue   { background: var(--lh-peri-100);   color: var(--lh-peri-600); }
.lh-badge--amber  { background: var(--lh-amber-100);  color: var(--lh-amber); }
.lh-badge--red    { background: var(--lh-red-100);    color: var(--lh-red); }
.lh-badge--teal   { background: var(--lh-mint-100);   color: var(--lh-mint-600); }
.lh-badge--violet { background: var(--lh-peri-100);   color: var(--lh-peri-600); }
.lh-badge__dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }

.lh-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--lh-line);
  background: var(--lh-card);
  font-size: 12.5px; font-weight: 580; color: var(--lh-ink-2);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
button.lh-chip { cursor: pointer; }
button.lh-chip:hover { border-color: var(--lh-primary); background: var(--lh-primary-050); color: var(--lh-ink); }
button.lh-chip:active { transform: scale(.98); }

/* -------------------------------------------------------------- tables --- */

.lh-tablewrap { overflow-x: auto; }
.lh-tablewrap::-webkit-scrollbar { height: 8px; }
.lh-tablewrap::-webkit-scrollbar-thumb { background: var(--lh-line); border-radius: 8px; }

.lh-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lh-table th {
  text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--lh-ink-3);
  padding: 11px 16px;
  border-bottom: 1px solid var(--lh-line);
  white-space: nowrap;
  background: var(--lh-card);
}
.lh-table th:first-child { border-top-left-radius: calc(var(--r-xl) - 1px); }
.lh-table th:last-child  { border-top-right-radius: calc(var(--r-xl) - 1px); }
.lh-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--lh-line-2);
  vertical-align: middle;
}
.lh-table tbody tr { transition: background var(--fast) var(--ease); }
.lh-table tbody tr[data-click] { cursor: pointer; }
.lh-table tbody tr:hover { background: var(--lh-primary-050); }
.lh-table tbody tr:last-child td { border-bottom: 0; }
.lh-t-strong { font-weight: 620; color: var(--lh-ink); }
.lh-t-sub { font-size: 12px; color: var(--lh-ink-3); margin-top: 2px; line-height: 1.4; }
.lh-t-num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.lh-t-right { text-align: right; }

.lh-cellstack { display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------------- filter bar ---- */

.lh-filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }

.lh-field {
  min-height: 38px; padding: 0 13px;
  border: 1px solid var(--lh-line);
  border-radius: var(--r-md);
  background: var(--lh-card);
  font: inherit; font-size: 13.5px; color: var(--lh-ink);
  box-shadow: var(--sh-1);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.lh-field:hover { border-color: #CBD9E3; }
.lh-field:focus {
  outline: none; border-color: var(--lh-primary);
  box-shadow: 0 0 0 3px rgba(87, 140, 176, .16);
}
select.lh-field {
  padding-right: 32px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238797A5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.lh-field--grow { flex: 1; min-width: 180px; }
textarea.lh-field { padding: 10px 13px; resize: vertical; min-height: 84px; line-height: 1.6; }

.lh-segment {
  display: inline-flex; gap: 2px;
  background: var(--lh-sand-2); border: 1px solid var(--lh-line);
  border-radius: var(--r-md); padding: 3px;
}
.lh-segment button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 620; color: var(--lh-ink-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.lh-segment button:hover { color: var(--lh-ink); }
.lh-segment button.is-on { background: var(--lh-card); color: var(--lh-primary-700); box-shadow: var(--sh-1); }

/* ---------------------------------------------------------------- tabs --- */

.lh-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--lh-line);
  margin-bottom: 20px; overflow-x: auto; scrollbar-width: none;
}
.lh-tabs::-webkit-scrollbar { display: none; }
.lh-tabs button {
  border: 0; background: transparent; cursor: pointer;
  padding: 11px 14px; font-size: 13.5px; font-weight: 620;
  color: var(--lh-ink-2); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.lh-tabs button:hover { color: var(--lh-ink); }
.lh-tabs button.is-on { color: var(--lh-primary-700); border-bottom-color: var(--lh-primary); }

/* -------------------------------------------------------------- kanban --- */

.lh-board {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(262px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start;
}
.lh-board::-webkit-scrollbar { height: 8px; }
.lh-board::-webkit-scrollbar-thumb { background: var(--lh-line); border-radius: 8px; }

.lh-col {
  background: rgba(233, 240, 245, .72);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-xl);
  padding: 10px; min-height: 130px;
}
.lh-col__head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 11px; }
.lh-col__title { font-size: 12.5px; font-weight: 700; letter-spacing: -0.005em; }
.lh-col__n {
  font-size: 11px; font-weight: 700; color: var(--lh-ink-3);
  background: var(--lh-card); border-radius: var(--r-pill); padding: 2px 8px;
  box-shadow: inset 0 0 0 1px rgba(23, 36, 46, .05);
}
.lh-col__list { display: grid; gap: 8px; }

/* concentric: column radius 18 minus 10 padding */
.lh-ticket {
  background: var(--lh-card);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-sm);
  padding: 12px 13px; cursor: pointer;
  box-shadow: var(--sh-1);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.lh-ticket:hover { transform: translateY(-1px); box-shadow: var(--sh-2); border-color: #CBD9E3; }
.lh-ticket:active { transform: scale(.99); }
.lh-ticket__top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.lh-ticket__name { font-weight: 660; font-size: 13.5px; letter-spacing: -0.01em; }
.lh-ticket__meta { font-size: 12px; color: var(--lh-ink-3); line-height: 1.5; margin-top: 3px; }
.lh-ticket__foot {
  display: flex; align-items: center; gap: 7px;
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--lh-line-2);
}

/* ------------------------------------------------------------- listbox --- */

.lh-list { display: grid; }
.lh-list__row {
  display: flex; align-items: center; gap: 13px;
  min-height: 56px; padding: 12px 20px;
  border-bottom: 1px solid var(--lh-line-2);
  transition: background var(--fast) var(--ease);
}
a.lh-list__row, .lh-list__row[data-click], .lh-list__row[data-demo] { cursor: pointer; }
.lh-list__row:last-child { border-bottom: 0; }
.lh-list__row:hover { background: var(--lh-primary-050); }
.lh-list__main { flex: 1; min-width: 0; }
.lh-list__title { font-size: 13.5px; font-weight: 620; letter-spacing: -0.008em; }
.lh-list__sub { font-size: 12.5px; color: var(--lh-ink-3); margin-top: 2px; line-height: 1.45; }

/* ------------------------------------------------------------ progress --- */

.lh-bar {
  height: 6px; border-radius: var(--r-pill);
  background: var(--lh-sand-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(23, 36, 46, .03);
}
.lh-bar__fill {
  height: 100%; border-radius: var(--r-pill); background: var(--lh-primary);
  transition: width var(--slow) var(--ease);
}
.lh-bar__fill--amber { background: var(--lh-amber); }
.lh-bar__fill--red   { background: var(--lh-red); }
.lh-bar__fill--blue  { background: var(--lh-peri-600); }

/* ---------------------------------------------------------- bar chart ---- */

.lh-chart { width: 100%; height: auto; display: block; overflow: visible; }
.lh-chart text { font-family: inherit; font-variant-numeric: tabular-nums; }
.lh-chart__grid { stroke: var(--lh-line-2); stroke-width: 1; }
.lh-chart__base { stroke: var(--lh-line); stroke-width: 1; }
.lh-chart__axis { fill: var(--lh-ink-3); font-size: 11px; font-weight: 600; }
.lh-chart__hit { fill: transparent; transition: fill var(--fast) var(--ease); }
.lh-chart__bar { transition: opacity var(--fast) var(--ease); }
.lh-chart__col:hover .lh-chart__bar { opacity: .86; }
.lh-chart__col:hover .lh-chart__hit { fill: rgba(87, 140, 176, .07); }
.lh-chart__val { fill: var(--lh-ink-2); font-size: 10.5px; font-weight: 680; opacity: 0; transition: opacity var(--fast) var(--ease); }
.lh-chart__col:hover .lh-chart__val { opacity: 1; }

.lh-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--lh-ink-2); }
.lh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lh-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* --------------------------------------------------------- donut/meter --- */

.lh-donut { display: flex; align-items: center; gap: 18px; }
.lh-donut__ring {
  width: 106px; height: 106px; flex: 0 0 auto;
  display: grid; place-items: center; position: relative;
}
.lh-donut__ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.lh-donut__num {
  position: relative; z-index: 1; font-size: 22px; font-weight: 720;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- drawer ---- */

.lh-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(23, 36, 46, .40);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--med) var(--ease);
}
.lh-scrim.is-open { opacity: 1; pointer-events: auto; }

.lh-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(560px, 100%);
  background: var(--lh-card);
  box-shadow: var(--sh-3);
  transform: translateX(100%);
  transition: transform var(--med) var(--ease);
  display: flex; flex-direction: column;
  will-change: transform;
}
.lh-drawer.is-open { transform: translateX(0); }
.lh-drawer__head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--lh-line);
  display: flex; align-items: flex-start; gap: 12px;
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(169, 217, 217, .22), transparent 60%),
    var(--lh-card);
}
.lh-drawer__head h2 { font-size: 18px; letter-spacing: -0.022em; }
.lh-drawer__head p { font-size: 13px; color: var(--lh-ink-3); margin-top: 4px; }
.lh-drawer__body { padding: 20px 22px 32px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.lh-drawer__foot {
  padding: 14px 22px; border-top: 1px solid var(--lh-line);
  display: flex; gap: 9px; justify-content: flex-end;
  background: var(--lh-sand);
}

.lh-defs { display: grid; gap: 1px; background: var(--lh-line-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--lh-line-2); }
.lh-def { background: var(--lh-card); padding: 11px 14px; display: flex; gap: 14px; align-items: flex-start; }
.lh-def__k { font-size: 12.5px; color: var(--lh-ink-3); font-weight: 600; width: 132px; flex: 0 0 auto; }
.lh-def__v { font-size: 13.5px; flex: 1; min-width: 0; }

.lh-section-title {
  font-size: 11px; font-weight: 720; letter-spacing: .08em;
  text-transform: uppercase; color: var(--lh-ink-3);
  margin: 24px 0 10px;
}
.lh-section-title:first-child { margin-top: 0; }

/* -------------------------------------------------------- timeline ------ */

.lh-timeline { display: grid; }
.lh-tl { display: flex; gap: 13px; padding: 0 0 18px; position: relative; }
.lh-tl::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--lh-line-2);
}
.lh-tl:last-child { padding-bottom: 0; }
.lh-tl:last-child::before { display: none; }
.lh-tl__dot {
  width: 28px; height: 28px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: grid; place-items: center; z-index: 1;
  background: var(--lh-primary-100); color: var(--lh-primary-700);
  box-shadow: 0 0 0 3px var(--lh-card);
}
.lh-tl__dot--blue   { background: var(--lh-peri-100);  color: var(--lh-peri-600); }
.lh-tl__dot--amber  { background: var(--lh-amber-100); color: var(--lh-amber); }
.lh-tl__dot--red    { background: var(--lh-red-100);   color: var(--lh-red); }
.lh-tl__dot--violet { background: var(--lh-peri-100);  color: var(--lh-peri-600); }
.lh-tl__body { flex: 1; min-width: 0; padding-top: 4px; }
.lh-tl__what { font-size: 13.5px; }
.lh-tl__what a:hover { color: var(--lh-primary-600); text-decoration: underline; text-underline-offset: 2px; }
.lh-tl__who { font-size: 12px; color: var(--lh-ink-3); margin-top: 2px; }

/* -------------------------------------------------- website split view --- */

.lh-editor { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }

.lh-preview {
  background: var(--lh-card);
  border: 1px solid var(--lh-line);
  border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--sh-2);
  position: sticky; top: calc(var(--lh-topbar) + 20px);
}
.lh-preview__chrome {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--lh-sand-2);
  border-bottom: 1px solid var(--lh-line);
}
.lh-preview__dots { display: flex; gap: 5px; }
.lh-preview__dots i { width: 9px; height: 9px; border-radius: var(--r-pill); background: #C4D3DD; display: block; }
.lh-preview__url {
  flex: 1; background: var(--lh-card); border: 1px solid var(--lh-line);
  border-radius: var(--r-pill); padding: 5px 13px;
  font-size: 11.5px; color: var(--lh-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lh-preview__stage { padding: 22px; background: #FAFCFD; }

.lh-web {
  max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid var(--lh-line);
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--sh-2);
}
.lh-web__photo {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 90% at 20% 0%, #EDF6F7 0%, transparent 60%),
    linear-gradient(140deg, #DCEAF0, #C9DEE7 55%, #BBD3DF);
  display: grid; place-items: center; position: relative;
}
.lh-web__photo-note {
  font-size: 12px; font-weight: 620; color: #4F7389;
  background: rgba(255, 255, 255, .8); padding: 6px 13px; border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 7px;
  backdrop-filter: blur(4px);
}
.lh-web__tag {
  position: absolute; top: 13px; left: 13px;
  background: var(--lh-primary); color: #fff;
  font-size: 11.5px; font-weight: 680; padding: 5px 11px; border-radius: var(--r-pill);
  box-shadow: 0 1px 3px rgba(23, 36, 46, .18);
}
.lh-web__count {
  position: absolute; bottom: 13px; right: 13px;
  background: rgba(23, 36, 46, .7); color: #fff;
  font-size: 11.5px; font-weight: 620; padding: 4px 10px; border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
}
.lh-web__body { padding: 20px 22px 22px; }
.lh-web__eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--lh-primary-600); margin-bottom: 8px;
}
.lh-web__title { font-size: 20px; line-height: 1.25; letter-spacing: -0.024em; }
.lh-web__loc { font-size: 13.5px; color: var(--lh-ink-2); margin-top: 5px; }
.lh-web__feats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.lh-web__cta { margin-top: 18px; display: flex; gap: 9px; flex-wrap: wrap; }

.lh-phototray { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; }
.lh-photo {
  aspect-ratio: 4 / 3; border-radius: var(--r-md);
  background: linear-gradient(140deg, #E1EEF2, #C9DEE7);
  display: grid; place-items: center;
  color: #5A7F93; position: relative;
  border: 1px solid var(--lh-line);
}
.lh-photo--add {
  background: var(--lh-sand); border: 1.5px dashed #C4D3DD;
  color: var(--lh-ink-3); cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.lh-photo--add:hover { background: var(--lh-primary-050); color: var(--lh-primary-600); border-color: var(--lh-primary); }
.lh-photo--add:active { transform: scale(.98); }
.lh-photo__n {
  position: absolute; top: 5px; left: 6px;
  font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(23, 36, 46, .5); border-radius: var(--r-pill); padding: 1px 6px;
}

.lh-sync {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--lh-mint-100); color: var(--lh-mint-600);
  font-size: 13px; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(53, 128, 127, .12);
}
.lh-sync--warn {
  background: var(--lh-amber-100); color: var(--lh-amber);
  box-shadow: inset 0 0 0 1px rgba(138, 97, 19, .12);
}
.lh-sync .lh-spacer { flex: 1; }

/* ------------------------------------------------------------- labels ---- */

.lh-label { display: block; font-size: 12.5px; font-weight: 620; color: var(--lh-ink-2); margin-bottom: 6px; }
.lh-help { font-size: 12px; color: var(--lh-ink-3); margin-top: 6px; line-height: 1.5; }
.lh-formgrid { display: grid; gap: 15px; }
.lh-formgrid--2 { grid-template-columns: 1fr 1fr; }
.lh-formgrid .lh-field { width: 100%; }

.lh-switch {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 580; min-height: 40px;
}
.lh-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.lh-switch__track {
  width: 42px; height: 24px; border-radius: var(--r-pill);
  background: #CBD7E0; position: relative; flex: 0 0 auto;
  transition: background var(--med) var(--ease);
  box-shadow: inset 0 0 0 1px rgba(23, 36, 46, .05);
}
.lh-switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: var(--r-pill); background: #fff;
  transition: transform var(--med) var(--ease);
  box-shadow: 0 1px 3px rgba(23, 36, 46, .28);
}
.lh-switch input:checked + .lh-switch__track { background: var(--lh-primary); }
.lh-switch input:checked + .lh-switch__track::after { transform: translateX(18px); }
.lh-switch input:focus-visible + .lh-switch__track { outline: 2px solid var(--lh-primary); outline-offset: 2px; }

/* -------------------------------------------------------- empty/notes ---- */

.lh-empty { text-align: center; padding: 48px 24px; color: var(--lh-ink-3); position: relative; }
.lh-empty::before {
  content: ''; display: block; width: 54px; height: 54px; margin: 0 auto 14px;
  opacity: .24;
  background: url('brand/emblem.svg') no-repeat center / contain;
}
.lh-empty h3 { font-size: 14.5px; color: var(--lh-ink-2); margin-bottom: 5px; font-weight: 640; }
.lh-empty p { font-size: 13.5px; max-width: 44ch; margin: 0 auto; line-height: 1.6; }

.lh-note {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r-lg);
  background: var(--lh-peri-100); color: #45507A;
  font-size: 13px; line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgba(98, 112, 165, .12);
}
.lh-note--amber {
  background: var(--lh-amber-100); color: var(--lh-amber);
  box-shadow: inset 0 0 0 1px rgba(138, 97, 19, .12);
}
.lh-note--green {
  background: var(--lh-mint-100); color: var(--lh-mint-600);
  box-shadow: inset 0 0 0 1px rgba(53, 128, 127, .12);
}
.lh-note svg { margin-top: 2px; }

.lh-mock {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  background: var(--lh-nav); color: #BFD6E6;
  font-size: 11.5px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--r-pill);
  box-shadow: var(--sh-3);
  display: flex; align-items: center; gap: 8px;
}
.lh-mock i {
  width: 7px; height: 7px; border-radius: var(--r-pill);
  background: var(--lh-mint); display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .lh-mock i { animation: lh-pulse 2.6s ease-in-out infinite; }
}
@keyframes lh-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.lh-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 150;
  transform: translate(-50%, 14px);
  background: var(--lh-nav); color: #fff;
  padding: 12px 20px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--sh-3);
  display: flex; align-items: center; gap: 9px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  max-width: calc(100vw - 40px);
}
.lh-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- responsive ---- */

@media (max-width: 1180px) {
  .lh-split  { grid-template-columns: 1fr; }
  .lh-editor { grid-template-columns: 1fr; }
  .lh-preview { position: static; }
}

@media (max-width: 1023px) {
  .lh-app { grid-template-columns: 1fr; }
  .lh-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 110;
    width: var(--lh-sidebar);
    transform: translateX(-100%);
    transition: transform var(--med) var(--ease);
    will-change: transform;
  }
  .lh-side.is-open { transform: translateX(0); box-shadow: var(--sh-3); }
  .lh-burger { display: grid; }
  .lh-view { padding: 22px 22px 64px; }
  .lh-top { padding: 0 22px; }
  .lh-search { max-width: none; }
}

@media (max-width: 767px) {
  .lh-view { padding: 20px 20px 72px; }
  .lh-top { padding: 0 20px; gap: 10px; }
  .lh-search { display: none; }
  .lh-user__text { display: none; }
  .lh-user { padding: 4px; }
  .lh-pagehead h1 { font-size: 21px; }
  .lh-pagehead { margin-bottom: 20px; }
  .lh-formgrid--2 { grid-template-columns: 1fr; }
  .lh-kpi__value { font-size: 25px; }
  .lh-roleswitch { max-width: 176px; }
  .lh-mock { display: none; }
  .lh-def { flex-direction: column; gap: 3px; }
  .lh-def__k { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .lh-side, .lh-top, .lh-mock, .lh-toast { display: none; }
  .lh-app { grid-template-columns: 1fr; }
  .lh-view::before { display: none; }
  .lh-card { box-shadow: none; break-inside: avoid; }
}
