:root {
  color-scheme: dark;
  --bg: #060913;
  --bg-soft: #090d19;
  --surface: rgba(13, 18, 32, .88);
  --surface-2: rgba(17, 23, 40, .94);
  --surface-3: #151b2d;
  --line: rgba(151, 161, 196, .14);
  --line-strong: rgba(151, 161, 196, .24);
  --text: #f4f5fb;
  --muted: #8f98ad;
  --muted-2: #697287;
  --violet: #8067ff;
  --violet-bright: #a693ff;
  --blue: #4c86ff;
  --cyan: #42c9e9;
  --green: #4dd591;
  --amber: #f3ab3d;
  --red: #ff5f72;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --sidebar: 252px;
  --topbar: 82px;
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 79% -10%, rgba(93, 65, 211, .15), transparent 32rem),
    radial-gradient(circle at -5% 75%, rgba(33, 90, 170, .09), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:not(:disabled), a, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
img[data-media-awaiting-hydration="true"] { visibility: hidden; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

svg.ph-icon {
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
  overflow: visible;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 3px; }
::selection { color: white; background: rgba(128, 103, 255, .55); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: rgba(130, 140, 168, .32); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(139, 132, 255, .16);
  border-radius: 14px;
  box-shadow:
    0 12px 30px rgba(27, 51, 166, .24),
    0 0 24px rgba(103, 76, 255, .12);
  object-fit: cover;
}
.brand-name {
  display: inline-flex;
  align-items: baseline;
  color: #f8f8ff;
  font-size: 1.28rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -.047em;
  text-shadow: 0 6px 20px rgba(0, 0, 0, .36);
}
.brand-name span {
  margin-left: .11em;
  background: linear-gradient(118deg, #b4a8ff 10%, #7d6bff 50%, #66c6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #a995ff;
  font-weight: 820;
  letter-spacing: -.035em;
  -webkit-text-fill-color: transparent;
}
.brand-name::after {
  width: 4px;
  height: 4px;
  margin: -3px 0 0 3px;
  align-self: flex-start;
  border: 1.5px solid #79c9ff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(85, 184, 255, .7);
  content: "";
}
.eyebrow, .panel-kicker, .page-identity p, .palette-body > p, .quick-create-menu > p {
  margin: 0;
  color: var(--muted-2);
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.button, .icon-button {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(19, 25, 43, .75);
  color: var(--text);
  transition: border-color .2s, background .2s, color .2s, transform .2s, box-shadow .2s;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  font-size: .84rem;
  font-weight: 650;
}
.button:hover, .icon-button:hover { border-color: rgba(128, 103, 255, .46); background: rgba(31, 36, 62, .94); }
.button:active, .icon-button:active { transform: translateY(1px); }
.button-primary {
  border-color: rgba(129, 103, 255, .65);
  background: linear-gradient(135deg, #7556ef, #5a37d8);
  box-shadow: 0 10px 24px rgba(80, 48, 201, .22), inset 0 1px rgba(255,255,255,.16);
}
.button-primary:hover { background: linear-gradient(135deg, #876cff, #6846e9); box-shadow: 0 12px 30px rgba(80, 48, 201, .34); }
.button-ghost { background: rgba(12, 17, 30, .66); }
.button-danger { border-color: rgba(255, 95, 114, .38); background: rgba(255, 95, 114, .12); color: #ff9ba7; }
.button-large { min-height: 50px; border-radius: 13px; }
.button-small { min-height: 34px; padding: 0 11px; font-size: .76rem; }
.button-full { width: 100%; }
.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.icon-only { width: 42px; padding: 0; }
.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--violet-bright);
  font-size: .78rem;
  font-weight: 620;
}
.text-link:hover { color: #c1b7ff; }
kbd {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(255,255,255,.035);
  color: var(--muted-2);
  font: 600 .68rem/1.3 inherit;
}

/* Authentication */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100vh;
  overflow: auto;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(4, 7, 15, .82), rgba(4, 7, 15, .54) 36%, rgba(4, 7, 15, .34) 58%, rgba(4, 7, 15, .88)),
    linear-gradient(180deg, rgba(5, 8, 17, .1), rgba(5, 8, 17, .2) 64%, rgba(5, 8, 17, .8)),
    radial-gradient(circle at 20% 42%, rgba(103, 68, 220, .2), transparent 38rem),
    #050811;
}
.auth-screen::before {
  content: "";
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: linear-gradient(rgba(121,136,184,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(121,136,184,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 75%, transparent);
}
.auth-screen::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: url("/assets/object360-building.png") -8vw 58% / min(90vw, 1480px) auto no-repeat;
  filter: saturate(1.04) contrast(1.02);
  -webkit-mask-image: radial-gradient(
    ellipse 64% 78% at 32% 54%,
    #000 38%,
    rgba(0, 0, 0, .94) 52%,
    rgba(0, 0, 0, .42) 72%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 64% 78% at 32% 54%,
    #000 38%,
    rgba(0, 0, 0, .94) 52%,
    rgba(0, 0, 0, .42) 72%,
    transparent 100%
  );
  content: "";
}
.auth-ambient { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .18; }
.auth-ambient-one { width: 420px; height: 420px; left: -160px; top: -80px; background: #7150ff; }
.auth-ambient-two { width: 360px; height: 360px; right: -100px; bottom: -120px; background: #2754c7; }
.auth-stage {
  position: relative;
  z-index: 2;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, .75fr);
}
.auth-story {
  min-height: 720px;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 72px);
}
.auth-brand { align-self: flex-start; }
.auth-brand .brand-mark { width: 54px; height: 54px; border-radius: 17px; }
.auth-brand .brand-name { font-size: 1.48rem; }
.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-top: clamp(70px, 12vh, 145px);
}
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: var(--muted); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.kicker span { width: 26px; height: 2px; background: var(--violet); box-shadow: 0 0 12px var(--violet); }
.auth-story h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: .98;
  letter-spacing: -.06em;
  text-shadow: 0 10px 36px rgba(2, 4, 12, .96), 0 2px 9px #050811;
}
.auth-story h1 em { color: var(--violet-bright); font-style: normal; }
.auth-story-copy > p:last-child {
  max-width: 590px;
  margin: 28px 0 0;
  color: #b8bfd0;
  font-size: 1.06rem;
  line-height: 1.75;
  text-shadow: 0 4px 18px rgba(2, 4, 12, .98);
}
.auth-twin { display: none; }
.auth-proof {
  margin-top: auto;
  display: flex;
  gap: clamp(28px, 5vw, 70px);
  padding-top: 32px;
}
.auth-proof div { display: grid; gap: 5px; }
.auth-proof strong { font-size: 1.42rem; color: #d8d3ff; }
.auth-proof span { color: var(--muted-2); font-size: .73rem; }
.auth-panel {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 36px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 15, 28, .7), rgba(6, 9, 19, .94));
  backdrop-filter: blur(20px);
}
.auth-card { width: min(410px, 100%); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 36px; }
.auth-card > h2 { margin: 12px 0 9px; font-size: 1.85rem; letter-spacing: -.035em; }
.auth-lead { margin: 0 0 28px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.desktop-update-banner {
  position: relative;
  display: grid;
  gap: 7px;
  margin: -10px 0 18px;
  padding: 16px 48px 16px 17px;
  border: 1px solid rgba(135, 103, 255, .34);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(91, 63, 202, .21), rgba(29, 38, 69, .54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.desktop-update-banner[hidden] { display: none; }
.desktop-update-kicker {
  color: #a88dff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.desktop-update-banner strong { color: #f4f1ff; font-size: .88rem; line-height: 1.35; }
.desktop-update-banner > span:not(.desktop-update-kicker) {
  color: var(--muted);
  font-size: .71rem;
  line-height: 1.45;
}
.desktop-update-banner .button {
  justify-self: start;
  min-height: 34px;
  margin-top: 3px;
  padding: 0 15px;
  font-size: .72rem;
}
.desktop-update-dismiss {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.desktop-update-dismiss svg { width: 16px; height: 16px; }
.desktop-update-dismiss:hover { background: rgba(255,255,255,.07); color: #fff; }
.auth-update-check {
  margin-left: 3px;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: transparent;
  color: #a995ff;
  font: inherit;
  cursor: pointer;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 8, 17, .72);
}
.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.auth-tabs button.active { background: rgba(126, 96, 255, .18); color: #d8d0ff; box-shadow: inset 0 0 0 1px rgba(129, 103, 255, .22); }
.auth-form { display: grid; gap: 10px; }
.auth-form > label, .label-row label { color: #c3c8d6; font-size: .76rem; font-weight: 600; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.field-with-icon { position: relative; }
.field-with-icon > svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; color: var(--muted-2); transform: translateY(-50%); }
.auth-handle-prefix {
  position: absolute;
  z-index: 1;
  left: 38px;
  top: 50%;
  color: var(--violet-bright);
  font-size: .86rem;
  font-weight: 750;
  transform: translateY(-50%);
  pointer-events: none;
}
.field-with-icon:has(.auth-handle-prefix) input { padding-left: 54px; }
.auth-field-hint { margin: -3px 0 3px; color: var(--muted-2); font-size: .68rem; line-height: 1.45; }
.field-with-icon input, .modal-form input, .modal-form select, .modal-form textarea, .control, .select-control {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(10, 14, 26, .88);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field-with-icon input { padding: 0 44px 0 42px; }
.field-with-icon input:focus, .modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus, .control:focus {
  border-color: rgba(128, 103, 255, .72);
  background: rgba(13, 18, 34, .98);
  box-shadow: 0 0 0 3px rgba(128, 103, 255, .1);
}
.reveal-password { position: absolute; right: 6px; top: 5px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.reveal-password:hover { background: rgba(128,103,255,.08); color: #c9c0ff; }
.reveal-password svg { width: 18px; height: 18px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 7px 0 9px; color: var(--muted) !important; }
.checkbox-row input { accent-color: var(--violet); }
.form-error { min-height: 20px; margin: 12px 0 0; color: #ff8291; font-size: .77rem; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 24px 0 0; color: var(--muted-2); font-size: .7rem; }
.auth-security svg { width: 15px; height: 15px; color: var(--green); }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 20, .96);
  backdrop-filter: blur(22px);
}
.sidebar-head { height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.sidebar-close { display: none; }
.organization-switcher { padding: 19px 16px 11px; }
.organization-switcher > label { display: block; margin: 0 0 8px 5px; color: var(--muted-2); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.organization-switcher-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 7px; }
.organization-create-button { width: 40px; height: 40px; border-radius: 11px; }
.select-shell {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 21, 36, .78);
}
.organization-avatar, .user-avatar {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, #8067ff, #4b36b8);
  color: white;
  font-weight: 750;
}
.organization-avatar { width: 32px; height: 32px; font-size: .7rem; }
.select-shell select {
  z-index: 1;
  grid-column: 2 / 4;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 0 24px 0 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: #d9dce6;
  font-size: .75rem;
  outline: 0;
  cursor: pointer;
}
.select-shell:focus-within { border-color: rgba(128,103,255,.56); box-shadow: 0 0 0 3px rgba(128,103,255,.1); }
.select-shell > svg {
  z-index: 2;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  pointer-events: none;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.sidebar-nav > p { margin: 18px 10px 7px; color: #555f74; font-size: .6rem; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.nav-item {
  width: 100%;
  min-height: 43px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 2px 0;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #8e97aa;
  text-align: left;
  font-size: .77rem;
}
.nav-item > svg {
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 1px solid rgba(128,103,255,.1);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(76,134,255,.055), rgba(128,103,255,.065));
  color: #8994b4;
  transition: border-color .18s ease, background .18s ease, color .18s ease, filter .18s ease;
}
.nav-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { color: #d9dce7; background: rgba(255,255,255,.035); }
.nav-item:hover > svg { border-color: rgba(101,133,229,.2); background: linear-gradient(145deg, rgba(76,134,255,.09), rgba(128,103,255,.1)); color: #aab7db; }
.nav-item.active {
  border-color: rgba(128,103,255,.18);
  background: linear-gradient(90deg, rgba(117, 84, 239, .19), rgba(117,84,239,.035));
  color: #ddd7ff;
}
.nav-item.active > svg { border-color: rgba(128,103,255,.28); background: linear-gradient(145deg, rgba(76,134,255,.13), rgba(128,103,255,.18)); color: var(--violet-bright); filter: drop-shadow(0 0 7px rgba(128,103,255,.34)); }
.nav-item kbd { border: 0; background: transparent; }
.nav-count { min-width: 22px; padding: 2px 5px; border-radius: 7px; background: rgba(128, 103, 255, .11); color: #9c89ff; font-size: .61rem; text-align: center; }
.nav-count.chat-unread-count { background: rgba(255,95,114,.14); color: #ff94a1; }
.nav-count.attention { background: rgba(243, 171, 61, .1); color: #eeb051; }
.nav-count.danger { background: rgba(255, 95, 114, .12); color: #ff8492; }
.nav-ai i { border: 1px solid rgba(128,103,255,.34); border-radius: 5px; padding: 2px 4px; color: #a996ff; font: 700 .5rem/1 inherit; }
.sidebar-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.sync-card {
  width: calc(100% - 6px);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 3px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(18, 24, 39, .62);
  color: inherit;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}
.sync-card:hover,
.sync-card:focus-visible { border-color: rgba(128,103,255,.28); background: rgba(128,103,255,.08); }
.sync-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(77,213,145,.16); border-radius: 9px; background: rgba(77,213,145,.1); color: var(--green); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.sync-icon[data-state="syncing"], .sync-icon[data-state="pending"] { border-color: rgba(128,103,255,.2); background: linear-gradient(145deg, rgba(76,134,255,.08), rgba(128,103,255,.14)); color: var(--violet-bright); }
.sync-icon[data-state="offline"] { border-color: rgba(243,171,61,.17); background: rgba(243,171,61,.09); color: var(--amber); }
.sync-icon svg { width: 16px; height: 16px; }
.sync-card > div { min-width: 0; display: grid; gap: 2px; }
.sync-card strong { overflow: hidden; color: #cbd0dd; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.sync-card small { color: var(--muted-2); font-size: .58rem; }
.sync-card b { margin-left: auto; min-width: 20px; padding: 2px 5px; border-radius: 99px; background: var(--amber); color: #171107; font-size: .6rem; text-align: center; }
.field-link {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 14px;
  align-items: center;
  gap: 8px;
  margin: 8px 3px 0;
  padding: 9px;
  border: 1px solid rgba(128,103,255,.16);
  border-radius: 11px;
  background: rgba(128,103,255,.055);
}
.field-link > svg:first-child { width: 18px; height: 18px; color: var(--violet-bright); }
.field-link > svg:last-child { width: 13px; height: 13px; color: var(--muted-2); }
.field-link span { min-width: 0; display: grid; gap: 3px; }
.field-link strong { font-size: .66rem; }
.field-link small { overflow: hidden; color: var(--muted-2); font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 19, .84);
  backdrop-filter: blur(22px);
}
.page-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.page-identity h1 { margin: 4px 0 0; font-size: 1.28rem; letter-spacing: -.035em; }
.menu-button { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-sync {
  position: relative;
  min-width: 146px;
  height: 42px;
  padding-inline: 13px;
  white-space: nowrap;
}
.topbar-sync > svg { width: 16px; height: 16px; }
.topbar-sync > b {
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--amber);
  color: #171107;
  font-size: .56rem;
}
.topbar-sync.has-pending { border-color: rgba(243,171,61,.3); color: #f2c272; }
.topbar-sync.is-syncing > svg { animation: object360-sync-spin 1s linear infinite; }
@keyframes object360-sync-spin { to { transform: rotate(360deg); } }
.global-search-shell {
  width: clamp(220px, 28vw, 390px);
  height: 42px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(13, 18, 31, .75);
  color: var(--muted);
}
.global-search-shell svg { width: 17px; height: 17px; }
.global-search-shell input { min-width: 0; border: 0; background: transparent; color: var(--text); outline: 0; font-size: .76rem; }
.global-search-shell input::placeholder { color: #626b7e; }
.has-indicator { position: relative; }
.has-indicator > span { position: absolute; right: 6px; top: 5px; min-width: 14px; height: 14px; padding: 0 3px; border: 2px solid #0a0e1a; border-radius: 99px; background: var(--red); color: white; font-size: .5rem; line-height: 10px; }
.quick-create { min-width: 104px; }
.user-menu-button {
  min-width: 182px;
  height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15,20,34,.75);
  text-align: left;
}
.user-avatar { width: 34px; height: 34px; font-size: .67rem; }
.user-avatar > span { position: relative; z-index: 1; }
.user-avatar > img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-copy { min-width: 0; display: grid; gap: 2px; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .7rem; }
.user-copy small { color: var(--muted-2); font-size: .57rem; }
.user-menu-button > svg { width: 13px; height: 13px; color: var(--muted-2); }
.view-host { width: min(1720px, 100%); min-height: calc(100vh - var(--topbar)); margin: auto; padding: 24px 28px 48px; outline: none; }
.view-page { animation: view-in .24s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.mobile-nav { display: none; }
.sidebar-scrim { display: none; }

/* Shared view composition */
.page-toolbar {
  min-height: 45px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.page-intro { margin: 0 0 7px; color: #c9cedb; font-size: .83rem; }
.freshness { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: .65rem; }
.freshness i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions select, .panel-head select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 30px 0 10px;
  background: #0d1220;
  color: var(--muted);
  font-size: .69rem;
}
.panel, .dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(14, 19, 33, .94), rgba(8, 12, 23, .94));
  box-shadow: 0 16px 42px rgba(0,0,0,.14);
}
.panel-head, .panel-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(151,161,196,.09);
}
.panel-title-wrap { min-width: 0; display: flex; align-items: center; gap: 11px; }
.panel-title-wrap > div { min-width: 0; }
.panel-title-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 11px;
  background: rgba(128,103,255,.08);
  opacity: .94;
}
.panel-title-icon svg { width: 19px; height: 19px; }
.panel-title-icon.tone-success { background: rgba(77,213,145,.08); }
.panel-title-icon.tone-warning { background: rgba(243,171,61,.08); }
.panel-title-icon.tone-danger { background: rgba(255,95,114,.08); }
.panel-title-icon.tone-info { background: rgba(76,134,255,.08); }
.panel-title-icon.tone-accent { background: rgba(128,103,255,.09); }
.panel-head h2, .panel-header h2 { margin: 5px 0 0; font-size: .96rem; letter-spacing: -.02em; }
.panel-body { padding: 18px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.muted { color: var(--muted); }
.dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.gray { background: #596173; }
.status-pill, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(145,155,185,.075);
  color: #9ca5b8;
  font-size: .59rem;
  font-style: normal;
  white-space: nowrap;
}
.status-pill.green, .badge.tone-green, .badge.status-done, .badge.status-ok { border-color: rgba(77,213,145,.22); background: rgba(77,213,145,.09); color: #70dda5; }
.status-pill.amber, .badge.tone-amber, .badge.status-attention, .badge.status-overdue { border-color: rgba(243,171,61,.22); background: rgba(243,171,61,.09); color: #f0b75f; }
.status-pill.red, .badge.tone-red, .badge.status-problem, .badge.status-critical, .badge.status-open { border-color: rgba(255,95,114,.22); background: rgba(255,95,114,.09); color: #ff8997; }
.status-pill.violet, .badge.tone-violet, .badge.status-planned { border-color: rgba(128,103,255,.24); background: rgba(128,103,255,.1); color: #a996ff; }
.status-pill.blue, .badge.tone-blue, .badge.status-in_progress { border-color: rgba(76,134,255,.24); background: rgba(76,134,255,.1); color: #78a2ff; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 11px;
  margin-bottom: 13px;
}
.kpi-card {
  position: relative;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(17,23,40,.92), rgba(9,13,24,.92));
}
.kpi-card::after { content: ""; position: absolute; inset: auto -35px -48px auto; width: 90px; height: 90px; border-radius: 50%; background: rgba(128,103,255,.08); filter: blur(20px); }
.kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(128,103,255,.2);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(76,134,255,.1), rgba(128,103,255,.14));
  color: var(--violet-bright);
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-icon.blue, .kpi-icon.tone-blue { border-color: rgba(76,134,255,.18); background: linear-gradient(145deg, rgba(76,134,255,.14), rgba(91,78,194,.08)); color: #6f9aff; }
.kpi-icon.cyan, .kpi-icon.tone-cyan { border-color: rgba(66,201,233,.17); background: rgba(66,201,233,.09); color: #62d3ec; }
.kpi-icon.green, .kpi-icon.tone-green { border-color: rgba(77,213,145,.17); background: rgba(77,213,145,.09); color: #68dca1; }
.kpi-icon.red, .kpi-icon.tone-red { border-color: rgba(255,95,114,.17); background: rgba(255,95,114,.09); color: #ff7888; }
.kpi-icon.tone-success { border: 1px solid rgba(77,213,145,.16); background: rgba(77,213,145,.09); color: #68dca1 !important; }
.kpi-icon.tone-warning { border: 1px solid rgba(243,171,61,.16); background: rgba(243,171,61,.09); color: #efb45a !important; }
.kpi-icon.tone-danger { border: 1px solid rgba(255,95,114,.16); background: rgba(255,95,114,.09); color: #ff7888 !important; }
.kpi-icon.tone-info { border: 1px solid rgba(76,134,255,.16); background: rgba(76,134,255,.09); color: #6f9aff !important; }
.kpi-icon.tone-accent { border: 1px solid rgba(128,103,255,.18); background: rgba(128,103,255,.1); color: var(--violet-bright) !important; }
.kpi-card > div, .kpi-copy { min-width: 0; display: grid; gap: 3px; }
.kpi-card span, .kpi-copy > span { color: var(--muted); font-size: .65rem; }
.kpi-card strong { font-size: 1.35rem; letter-spacing: -.04em; }
.kpi-card small { color: var(--muted-2); font-size: .57rem; }
.kpi-delta { margin-left: auto; align-self: flex-start; }
.mini-bars { width: 36px; height: 30px; margin-left: auto; display: flex; align-items: end; gap: 3px; }
.mini-bars i { width: 4px; border-radius: 2px; background: #4778dd; }
.mini-bars i:nth-child(1) { height: 32%; }.mini-bars i:nth-child(2) { height: 60%; }.mini-bars i:nth-child(3) { height: 48%; }.mini-bars i:nth-child(4) { height: 82%; }.mini-bars i:nth-child(5) { height: 70%; }
.mini-ring { width: 31px; height: 31px; margin-left: auto; border: 4px solid rgba(66,201,233,.16); border-top-color: var(--cyan); border-right-color: var(--cyan); border-radius: 50%; transform: rotate(22deg); }
.mini-trend { width: 38px; height: 23px; margin-left: auto; opacity: .65; background: linear-gradient(155deg, transparent 42%, var(--violet) 43% 49%, transparent 50%), linear-gradient(25deg, transparent 45%, var(--violet) 46% 52%, transparent 53%); }
.mini-trend.green { filter: hue-rotate(80deg); }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .72fr); gap: 13px; }
.twin-panel { min-height: 475px; }
.building-map {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  padding: 26px 6% 10px;
  perspective: 1000px;
  background:
    radial-gradient(circle at 50% 55%, rgba(80,61,184,.13), transparent 46%),
    linear-gradient(rgba(98,110,150,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98,110,150,.028) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}
.map-glow { position: absolute; left: 22%; right: 22%; bottom: 2%; height: 18%; border-radius: 50%; background: rgba(83,55,210,.24); filter: blur(36px); }
.floor {
  position: absolute;
  left: 9%;
  width: 82%;
  min-height: 112px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(125,137,177,.2);
  background: rgba(12,18,31,.9);
  box-shadow: 0 16px 25px rgba(0,0,0,.32);
  transform: rotateX(58deg) rotateZ(-3deg);
  transform-origin: center;
}
.floor-back { top: 24px; opacity: .65; }
.floor-middle { top: 100px; }
.floor-front { top: 180px; }
.room {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(145,155,185,.15);
  background: rgba(30,36,52,.72);
  color: #c4c9d5;
  text-align: left;
  transform: rotateZ(3deg);
  transition: transform .18s, filter .18s, border-color .18s;
}
.room:hover { z-index: 2; transform: rotateZ(3deg) translateY(-3px); filter: brightness(1.18); }
.room.wide { grid-column: span 2; }
.room span { font-size: .69rem; font-weight: 700; }
.room small { color: rgba(231,233,244,.58); font-size: .52rem; }
.room b { margin-top: 3px; font-size: .48rem; text-transform: uppercase; }
.room-ok { border-color: rgba(77,213,145,.35); background: linear-gradient(135deg, rgba(35,153,96,.44), rgba(18,67,51,.7)); box-shadow: inset 0 0 25px rgba(77,213,145,.09); }
.room-warning { border-color: rgba(243,171,61,.38); background: linear-gradient(135deg, rgba(175,104,26,.52), rgba(73,49,20,.75)); }
.room-critical { border-color: rgba(255,95,114,.42); background: linear-gradient(135deg, rgba(161,46,61,.56), rgba(66,24,33,.78)); }
.room-info { border-color: rgba(76,134,255,.43); background: linear-gradient(135deg, rgba(47,80,173,.55), rgba(27,37,76,.78)); }
.floor-tabs { position: absolute; z-index: 5; right: 16px; top: 18px; display: grid; gap: 4px; }
.floor-tabs button { min-width: 46px; min-height: 27px; border: 1px solid var(--line); border-radius: 7px; background: rgba(8,12,22,.86); color: var(--muted); font-size: .55rem; }
.floor-tabs button.active { border-color: rgba(128,103,255,.42); background: rgba(128,103,255,.17); color: #c6bcff; }
.status-legend { display: flex; flex-wrap: wrap; gap: 17px; padding: 13px 18px; border-top: 1px solid var(--line); }
.status-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .62rem; }
.status-legend b { color: #c9cdd7; }
.attention-panel { min-height: 475px; }
.event-list, .task-list { display: grid; }
.event-row, .task-row {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid rgba(151,161,196,.08);
  background: transparent;
  text-align: left;
}
.event-row:hover, .task-row:hover { background: rgba(255,255,255,.025); }
.event-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(128,103,255,.16); border-radius: 10px; box-shadow: inset 0 1px rgba(255,255,255,.035); }
.event-icon svg { width: 17px; height: 17px; }
.event-icon.red { border-color: rgba(255,95,114,.16); background: rgba(255,95,114,.1); color: var(--red); }
.event-icon.amber { border-color: rgba(243,171,61,.16); background: rgba(243,171,61,.1); color: var(--amber); }
.event-icon.violet { border-color: rgba(128,103,255,.2); background: linear-gradient(145deg, rgba(76,134,255,.08), rgba(128,103,255,.14)); color: var(--violet-bright); }
.event-icon.blue { border-color: rgba(76,134,255,.19); background: linear-gradient(145deg, rgba(76,134,255,.13), rgba(91,78,194,.07)); color: #6f9aff; }
.event-icon.green { border-color: rgba(77,213,145,.16); background: rgba(77,213,145,.1); color: var(--green); }
.event-row > span:nth-child(2), .task-row > span { min-width: 0; display: grid; gap: 4px; }
.event-row strong, .task-row strong { overflow: hidden; color: #cfd3df; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.event-row small, .task-row small { overflow: hidden; color: var(--muted-2); font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.work-panel, .chart-panel { min-height: 350px; }
.work-progress { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.progress-ring {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 6px solid rgba(77,213,145,.12);
  border-top-color: var(--green);
  border-right-color: var(--green);
  border-radius: 50%;
  transform: rotate(16deg);
}
.progress-ring > * { transform: rotate(-16deg); }
.progress-ring strong { font-size: .95rem; }.progress-ring small { color: var(--muted); font-size: .48rem; }
.work-progress > div:nth-child(2) { display: grid; gap: 4px; }
.work-progress > div:nth-child(2) > strong { font-size: .75rem; }.work-progress > div:nth-child(2) > span { color: var(--muted); font-size: .58rem; }
.avatar-stack { display: flex; margin-top: 4px; }
.avatar-stack i { width: 24px; height: 24px; display: grid; place-items: center; margin-right: -5px; border: 2px solid #0c1120; border-radius: 50%; background: #342765; color: #d8d2ff; font: 700 .47rem/1 inherit; }
.task-row { grid-template-columns: 40px minmax(0,1fr) auto; padding: 11px 16px; }
.task-row time { color: #858ea3; font-size: .58rem; }
.chart-summary { display: flex; align-items: end; justify-content: space-between; padding: 14px 18px 0; }
.chart-summary > div:first-child { display: grid; gap: 3px; }.chart-summary span { color: var(--muted); font-size: .58rem; }.chart-summary strong { font-size: 1.15rem; }
.chart-key { display: flex; gap: 12px; }.chart-key span { display: flex; align-items: center; gap: 5px; }.chart-key i { width: 7px; height: 7px; border-radius: 50%; }.chart-key i.violet { background: var(--violet); }.chart-key i.blue { background: var(--blue); }
.line-chart { position: relative; height: 210px; margin: 5px 18px 12px; color: var(--violet); }
.line-chart svg { position: relative; z-index: 2; width: 100%; height: 170px; overflow: visible; }
.line-chart .area { fill: url(#chartFill); stroke: none; }.line-chart .plan { fill: none; stroke: rgba(76,134,255,.55); stroke-dasharray: 5 6; }.line-chart .actual { fill: none; stroke: var(--violet-bright); stroke-width: 2.2; }.line-chart circle { fill: #d7d0ff; stroke: var(--violet); }
.chart-grid { position: absolute; inset: 8px 0 30px; display: grid; }.chart-grid i { border-top: 1px solid rgba(151,161,196,.08); }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: .55rem; }
.ai-panel { position: relative; min-height: 350px; padding: 22px; background: radial-gradient(circle at 75% 22%, rgba(106,70,230,.25), transparent 43%), linear-gradient(150deg,#11152a,#0a0d19); }
.ai-panel h2 { margin: 52px 0 12px; font-size: 1.2rem; }.ai-panel > p:not(.panel-kicker) { color: var(--muted); font-size: .72rem; line-height: 1.6; }.ai-panel > p strong { color: #c9bdff; }
.ai-panel ul { display: grid; gap: 9px; margin: 18px 0 22px; padding: 0; list-style: none; }.ai-panel li { display: flex; gap: 7px; color: #abb2c4; font-size: .65rem; }.ai-panel li svg { width: 14px; height: 14px; color: var(--green); }
.ai-orbit { position: absolute; right: 23px; top: 23px; width: 70px; height: 70px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.26); border-radius: 50%; box-shadow: 0 0 35px rgba(128,103,255,.2); }.ai-orbit::before { content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(128,103,255,.35); border-radius: 50%; }.ai-orbit b { color: #c5baff; font-size: .85rem; }

/* Dynamic application views */
.view-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgba(128, 103, 255, .28);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(128, 103, 255, .14), rgba(76, 134, 255, .07));
  color: #d7d1ff;
  font-size: .75rem;
}
.demo-banner span { color: var(--muted); }
.section-heading {
  min-height: 88px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.section-heading > div:first-child { min-width: 0; }
.section-heading > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}
.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--violet-bright);
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.section-heading h1 {
  margin: 0;
  color: #f6f6fb;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  font-weight: 690;
  letter-spacing: -.04em;
}
.section-heading p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.55;
}
.button-secondary { background: rgba(18, 24, 40, .82); }
.button-secondary:hover { border-color: var(--line-strong); background: rgba(27, 34, 55, .94); }
.button-danger {
  border-color: rgba(255, 95, 114, .28);
  background: rgba(255, 95, 114, .09);
  color: #ff8997;
}
.button-danger:hover { border-color: rgba(255, 95, 114, .5); background: rgba(255, 95, 114, .15); }
.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--violet-bright);
  font-size: .7rem;
}
.text-button:hover { color: #d4cdff; }
.ui-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.panel-value { color: #eceafb; font-size: .82rem; }
.muted-copy { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.tone-success { color: var(--green) !important; }
.tone-warning { color: var(--amber) !important; }
.tone-danger { color: var(--red) !important; }
.tone-info { color: var(--blue) !important; }
.tone-accent { color: var(--violet-bright) !important; }
.tone-muted { color: var(--muted) !important; }

.overview-hero {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(520px, 1.28fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 78% 44%, rgba(89, 55, 215, .2), transparent 34%),
    linear-gradient(125deg, rgba(15, 20, 35, .98), rgba(7, 10, 20, .94));
  box-shadow: var(--shadow);
}
.overview-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(128, 103, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 103, 255, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, black);
}
.overview-hero::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(13, 17, 31, .98) 0%,
    rgba(13, 17, 31, .94) 28%,
    rgba(13, 17, 31, .72) 39%,
    rgba(13, 17, 31, .24) 52%,
    transparent 68%
  );
  content: "";
}
.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: clamp(28px, 4.2vw, 68px);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--violet-bright);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero-kicker::before { content: ""; width: 24px; height: 2px; background: var(--violet); }
.hero-copy h1 {
  margin: 14px 0;
  font-size: clamp(2rem, 3.8vw, 4rem);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .98;
}
.hero-copy h1 em {
  color: transparent;
  background: linear-gradient(90deg, #f5f3ff 0%, #a895ff 68%, #6e90ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
}
.hero-copy p { max-width: 490px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.building-hero {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 12px 26px 46px 0;
  isolation: isolate;
}
.building-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 11%;
  right: 10%;
  bottom: 19%;
  height: 18%;
  border-radius: 50%;
  background: rgba(76, 54, 191, .32);
  filter: blur(35px);
}
.building-hero > img {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -7%;
  width: 122%;
  max-width: none;
  height: auto;
  transform: translateY(-51%);
  object-fit: cover;
  filter: saturate(1.08) contrast(1.03) drop-shadow(0 28px 28px rgba(0, 0, 0, .42));
  -webkit-mask-image: radial-gradient(ellipse 82% 78% at 54% 51%, #000 38%, rgba(0, 0, 0, .96) 52%, rgba(0, 0, 0, .58) 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 82% 78% at 54% 51%, #000 38%, rgba(0, 0, 0, .96) 52%, rgba(0, 0, 0, .58) 72%, transparent 100%);
}
.building-pin {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(7, 10, 18, .88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .36);
  color: #d9dce6;
  font-size: .58rem;
  backdrop-filter: blur(12px);
}
.building-pin span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.building-pin.pin-1 { left: 21%; top: 25%; }
.building-pin.pin-2 { right: 13%; top: 32%; }
.building-pin.pin-3 { left: 46%; bottom: 33%; }
.building-pin.pin-4 { right: 26%; bottom: 24%; }
.building-pin.pin-5 { left: 13%; bottom: 26%; }
.building-legend {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 13px;
  color: var(--muted);
  font-size: .57rem;
}
.dashboard-grid { display: grid; gap: 16px; }
.dashboard-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid rgba(151, 161, 196, .08);
  background: transparent;
  text-align: left;
}
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: rgba(255, 255, 255, .025); }
.row-icon, .table-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(128, 103, 255, .1);
  color: var(--violet-bright);
}
.row-icon svg, .table-icon svg { width: 18px; height: 18px; }
.row-main { min-width: 0; display: grid; gap: 4px; }
.row-main strong { overflow: hidden; color: #daddE6; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { overflow: hidden; color: var(--muted-2); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(151, 161, 196, .08);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item > div { min-width: 0; display: grid; gap: 4px; }
.activity-item strong { color: #daddE6; font-size: .68rem; }
.activity-item small, .activity-item time { color: var(--muted-2); font-size: .56rem; }
.activity-marker { width: 8px; height: 8px; margin-top: 4px; border: 2px solid currentColor; border-radius: 50%; box-shadow: 0 0 9px currentColor; }
.empty-state {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 24px;
  border: 1px dashed rgba(151, 161, 196, .18);
  border-radius: var(--radius);
  background: rgba(13, 18, 32, .55);
  color: var(--muted);
  text-align: center;
}
.empty-state-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 103, 255, .24);
  border-radius: 15px;
  background: rgba(128, 103, 255, .1);
  color: var(--violet-bright);
}
.empty-state-icon svg { width: 26px; height: 26px; }
.empty-state h2, .empty-state h3 { margin: 3px 0 0; color: #e6e7ee; font-size: 1rem; }
.empty-state p { max-width: 450px; margin: 0 0 6px; font-size: .7rem; line-height: 1.6; }

/* Charts */
.progress-wrap { display: grid; gap: 8px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .65rem; }
.progress-label strong { color: #e6e7ef; }
progress.progress-track { width: 100%; height: 7px; display: block; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: rgba(151, 161, 196, .11); }
progress.progress-track::-webkit-progress-bar { border-radius: inherit; background: rgba(151, 161, 196, .11); }
progress.progress-track::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--violet), #5b91ff); box-shadow: 0 0 15px rgba(128, 103, 255, .35); }
progress.progress-track::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--violet), #5b91ff); box-shadow: 0 0 15px rgba(128, 103, 255, .35); }
.chart-empty { min-height: 190px; display: grid; place-items: center; color: var(--muted); font-size: .7rem; }
svg.line-chart {
  width: 100%;
  height: auto;
  min-height: 220px;
  margin: 0;
  overflow: visible;
}
svg.line-chart .chart-grid { stroke: rgba(151, 161, 196, .11); stroke-width: 1; }
svg.line-chart .chart-area { fill: rgba(128, 103, 255, .12); stroke: none; }
svg.line-chart .chart-line { fill: none; stroke: var(--violet-bright); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(128, 103, 255, .55)); }
svg.line-chart .chart-point circle { fill: #a996ff; stroke: #0d1220; stroke-width: 3; }
svg.line-chart .chart-point text, svg.line-chart > text { fill: var(--muted-2); font-size: 10px; }
.donut-layout { min-height: 220px; display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr); align-items: center; gap: 20px; }
.donut-visual { position: relative; width: min(100%, 180px); aspect-ratio: 1; justify-self: center; }
.donut-chart { width: 100%; height: 100%; display: block; }
.donut-background { fill: none; stroke: rgba(151, 161, 196, .1); stroke-width: 12; }
.donut-segment { fill: none; stroke: currentColor; stroke-width: 12; stroke-linecap: butt; }
.donut-center { position: absolute; inset: 25%; display: grid; place-content: center; gap: 4px; text-align: center; pointer-events: none; }
.donut-center strong { color: #f1effc; font-size: 1.3rem; font-weight: 780; line-height: 1; }
.donut-center small { max-width: 78px; overflow: hidden; color: var(--muted); font-size: .56rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.segment-0 { color: var(--violet); }
.segment-1 { color: var(--blue); }
.segment-2 { color: var(--green); }
.segment-3 { color: var(--amber); }
.segment-4 { color: var(--red); }
.chart-legend { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; color: var(--muted); font-size: .65rem; }
.chart-legend strong { color: #d7dae4; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.legend-measure { display: grid; grid-template-columns: minmax(18px, auto) 32px; align-items: baseline; gap: 6px; text-align: right; }
.legend-measure small { color: var(--muted-2); font-size: .52rem; }
.bar-chart { min-height: 230px; display: flex; align-items: stretch; gap: 12px; padding: 18px 8px 0; border-bottom: 1px solid rgba(151, 161, 196, .1); }
.bar-column { min-width: 0; flex: 1; display: grid; grid-template-rows: 22px 1fr 32px; align-items: end; justify-items: center; gap: 6px; }
.bar-column strong { color: #d5d8e2; font-size: .62rem; }
.bar-column .bar { width: min(42px, 68%); height: 100%; min-height: 4px; overflow: visible; background: transparent; filter: drop-shadow(0 0 10px rgba(128, 103, 255, .12)); }
.bar-column .bar rect { fill: currentColor; stroke: none; }
.bar-column small { max-width: 100%; color: var(--muted-2); font-size: .54rem; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.analytics-empty-state {
  min-height: 190px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  place-content: center;
  align-items: center;
  gap: 13px;
  padding: 24px;
  border: 1px dashed rgba(151,161,196,.16);
  border-radius: 13px;
  background: rgba(151,161,196,.025);
}
.analytics-empty-state > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(77,213,145,.08);
  color: var(--green);
}
.analytics-empty-state strong { color: #e4e6ed; font-size: .74rem; }
.analytics-empty-state p { margin: 5px 0 0; color: var(--muted); font-size: .62rem; line-height: 1.5; }
.horizontal-bars { display: grid; gap: 16px; padding: 4px 0; }
.horizontal-bar-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 14px; }
.horizontal-bar-head { min-width: 0; display: contents; }
.horizontal-bar-head span { color: #cdd1dc; font-size: .68rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.horizontal-bar-head strong { color: #f0eef9; font-size: .68rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.horizontal-bar-track {
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
}
.horizontal-bar-track svg { width: 100%; height: 100%; display: block; overflow: hidden; stroke: none; }
.horizontal-bar-background { fill: rgba(151,161,196,.1); }
.horizontal-bar-background,
.horizontal-bar-fill { stroke: none; }
.horizontal-bar-fill { fill: currentColor; }
.horizontal-bar-row > small {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: .54rem;
  font-variant-numeric: tabular-nums;
}

/* Digital map */
.map-layout {
  min-height: calc(100vh - var(--topbar) - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}
.map-workspace, .room-details {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(13, 18, 32, .96), rgba(8, 12, 23, .96));
  box-shadow: 0 16px 42px rgba(0, 0, 0, .15);
}
.toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted-2);
  font-size: .56rem;
  font-weight: 650;
  letter-spacing: .04em;
}
.toolbar select, .filter-bar select {
  min-width: 168px;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #0d1220;
  color: #cdd1dc;
  font-size: .67rem;
}
.toolbar select:focus, .filter-bar select:focus { border-color: rgba(128, 103, 255, .55); }
.toolbar-spacer { flex: 1; }
.floorplan-stage {
  position: relative;
  min-height: 610px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 62px 42px 78px;
  background:
    radial-gradient(circle at 50% 48%, rgba(82, 56, 196, .14), transparent 43%),
    linear-gradient(rgba(133, 145, 183, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 145, 183, .035) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}
.floorplan-stage::before {
  content: "ИНТЕРАКТИВНЫЙ ПЛАН";
  position: absolute;
  top: 20px;
  left: 24px;
  color: var(--muted-2);
  font-size: .58rem;
  font-weight: 720;
  letter-spacing: .14em;
}
.floorplan {
  width: min(100%, 880px);
  min-height: 460px;
  display: grid;
  grid-template-columns: repeat(12, minmax(30px, 1fr));
  grid-template-rows: repeat(8, minmax(40px, 1fr));
  gap: 5px;
  padding: 7px;
  border: 2px solid rgba(177, 184, 210, .38);
  background: rgba(5, 8, 15, .72);
  box-shadow: 0 24px 55px rgba(0, 0, 0, .34), 0 0 70px rgba(74, 47, 182, .07);
}
.floor-room {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(151, 161, 196, .24);
  border-radius: 2px;
  background: rgba(25, 31, 48, .76);
  color: #d2d6e1;
  text-align: left;
  transition: transform .16s, filter .16s, border-color .16s, box-shadow .16s;
}
.floor-room::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background: currentColor;
}
.floor-room:hover { z-index: 3; transform: translateY(-2px); filter: brightness(1.18); }
.floor-room.selected { z-index: 4; border-color: #d6ceff; box-shadow: 0 0 0 2px rgba(128, 103, 255, .34), 0 0 28px rgba(128, 103, 255, .25); }
.floor-room > * { position: relative; z-index: 1; }
.floor-room .room-number { font-size: .63rem; font-weight: 800; }
.floor-room strong { max-width: 100%; overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.floor-room small { color: rgba(226, 229, 239, .6); font-size: .52rem; }
.floor-room.tone-success { border-color: rgba(77, 213, 145, .48); color: #69dda2 !important; }
.floor-room.tone-warning { border-color: rgba(243, 171, 61, .52); color: #f1b75f !important; }
.floor-room.tone-danger { border-color: rgba(255, 95, 114, .52); color: #ff7e8e !important; }
.floor-room.tone-muted { border-color: rgba(151, 161, 196, .25); color: #8690a6 !important; }
.room-shape-0 { grid-column: span 3; grid-row: span 2; }
.room-shape-1 { grid-column: span 4; grid-row: span 2; }
.room-shape-2 { grid-column: span 5; grid-row: span 3; }
.room-shape-3 { grid-column: span 4; grid-row: span 3; }
.room-shape-4 { grid-column: span 3; grid-row: span 3; }
.room-shape-5 { grid-column: span 5; grid-row: span 2; }
.room-shape-6 { grid-column: span 4; grid-row: span 3; }
.floorplan-legend {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 19, .74);
  font-size: .58rem;
  backdrop-filter: blur(10px);
}
.room-details { display: flex; flex-direction: column; min-height: 610px; }
.room-preview {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 10% 0, rgba(128, 103, 255, .12), transparent 50%);
}
.room-preview > span:first-child { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(128, 103, 255, .12); color: var(--violet-bright); }
.room-preview > span:first-child svg { width: 22px; height: 22px; }
.room-preview small { color: var(--muted); font-size: .56rem; }
.room-preview h2 { margin: 4px 0 0; font-size: .92rem; letter-spacing: -.02em; }
.details-list { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 10px 20px; }
.details-list div { display: grid; gap: 4px; padding: 11px 0; border-bottom: 1px solid rgba(151, 161, 196, .08); }
.details-list div:nth-child(even) { padding-left: 12px; }
.details-list dt { color: var(--muted-2); font-size: .56rem; }
.details-list dd { margin: 0; color: #d7dae4; font-size: .68rem; font-weight: 620; }
.room-assets { min-height: 0; flex: 1; padding: 8px 20px; }
.room-assets h3 { margin: 10px 0; font-size: .7rem; }
.room-assets > button {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(151, 161, 196, .08);
  background: transparent;
  text-align: left;
}
.room-assets > button > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(128, 103, 255, .1); color: var(--violet-bright); }
.room-assets > button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.room-assets strong { overflow: hidden; color: #d4d7e1; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.room-assets small { color: var(--muted-2); font-size: .52rem; }
.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

/* Registries and data tables */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 18, 32, .82);
}
.filter-search {
  min-width: 260px;
  min-height: 40px;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b101d;
  color: var(--muted-2);
}
.filter-search:focus-within { border-color: rgba(128, 103, 255, .55); box-shadow: 0 0 0 3px rgba(128, 103, 255, .08); }
.filter-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #e0e2ea; font-size: .68rem; }
.filter-search input::placeholder { color: var(--muted-2); }
.result-count { margin-left: auto; color: var(--muted); font-size: .62rem; white-space: nowrap; }
.asset-view-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(2, max-content);
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(151, 161, 196, .13);
  border-radius: 10px;
  background: rgba(5, 9, 18, .58);
}
.asset-view-toggle button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .56rem;
  font-weight: 700;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.asset-view-toggle button:hover { color: #e8e4ff; background: rgba(128, 103, 255, .08); }
.asset-view-toggle button.active {
  border-color: rgba(147, 124, 255, .3);
  background: linear-gradient(145deg, rgba(117, 87, 235, .28), rgba(80, 57, 169, .22));
  color: #f2efff;
  box-shadow: 0 5px 14px rgba(35, 22, 85, .22);
}
.asset-view-toggle button:focus-visible { outline: 2px solid rgba(153, 132, 255, .78); outline-offset: 2px; }
.asset-view-toggle svg { width: 15px; height: 15px; }
.data-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(13, 18, 32, .94), rgba(8, 12, 23, .94));
}
.data-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.data-table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 24, 40, .72);
  color: var(--muted-2);
  font-size: .55rem;
  font-weight: 720;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td {
  height: 62px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(151, 161, 196, .075);
  color: #aeb5c5;
  font-size: .63rem;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .16s; }
.data-table tbody tr:hover { background: rgba(128, 103, 255, .035); }
.entity-link {
  min-width: 220px;
  display: inline-grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.entity-link > span:last-child { min-width: 0; display: grid; gap: 3px; }
.entity-link strong { overflow: hidden; color: #e0e2e9; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.entity-link small { color: var(--muted-2); font-size: .53rem; }
.table-actions { width: 82px; white-space: nowrap; }
.table-actions button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.table-actions button:hover { border-color: var(--line); background: rgba(255, 255, 255, .035); color: #e1e3eb; }
.table-actions button:last-child:hover { border-color: rgba(255, 95, 114, .2); color: var(--red); }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(151, 161, 196, .07);
  color: #9ba4b7;
  font-size: .56rem;
  white-space: nowrap;
}
.status-badge .status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.status-success, .status-ok, .status-done, .status-completed, .status-closed { border-color: rgba(77, 213, 145, .22); background: rgba(77, 213, 145, .08); color: #69dca2; }
.status-warning, .status-attention, .status-overdue, .status-due { border-color: rgba(243, 171, 61, .22); background: rgba(243, 171, 61, .08); color: #eeb45b; }
.status-danger, .status-problem, .status-critical, .status-open { border-color: rgba(255, 95, 114, .22); background: rgba(255, 95, 114, .08); color: #ff8291; }
.status-info, .status-in_progress, .status-progress { border-color: rgba(76, 134, 255, .24); background: rgba(76, 134, 255, .09); color: #74a0ff; }
.status-violet, .status-planned, .status-draft { border-color: rgba(128, 103, 255, .24); background: rgba(128, 103, 255, .09); color: #a996ff; }

/* Task board, team and content cards */
.task-board, .kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  align-items: start;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.task-column, .kanban-column {
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 14, 26, .72);
}
.task-column-header, .kanban-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.task-column-header h3, .kanban-header h3 { margin: 0; font-size: .72rem; }
.task-column-header span, .kanban-header span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(151, 161, 196, .08); color: var(--muted); font-size: .56rem; }
.task-column-body, .kanban-list { display: grid; gap: 9px; padding: 10px; }
.task-card, .kanban-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(20, 26, 43, .93), rgba(13, 17, 30, .93));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  text-align: left;
}
.task-card:hover, .kanban-card:hover { border-color: rgba(128, 103, 255, .34); transform: translateY(-1px); }
.task-card h4, .kanban-card h4 { margin: 0; color: #e0e2e9; font-size: .68rem; line-height: 1.45; }
.task-card p, .kanban-card p { margin: 0; color: var(--muted); font-size: .57rem; line-height: 1.45; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-2); font-size: .53rem; }
.card-grid, .team-grid, .report-grid, .settings-grid, .incident-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 13px;
}
.entity-card, .employee-card, .report-card, .incident-card, .settings-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(17, 23, 40, .94), rgba(9, 13, 24, .94));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.entity-card:hover, .employee-card:hover, .report-card:hover, .incident-card:hover { border-color: rgba(128, 103, 255, .3); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-header h3 { margin: 0; color: #e1e3ea; font-size: .76rem; line-height: 1.4; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: .58rem; }
.employee-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
.employee-avatar, .avatar {
  position: relative;
  overflow: hidden;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 103, 255, .25);
  border-radius: 50%;
  background: linear-gradient(145deg, #31255b, #172242);
  color: #d9d2ff;
  font-size: .7rem;
  font-weight: 760;
}
.employee-avatar > span, .avatar > span { position: relative; z-index: 1; }
.employee-avatar > img, .avatar > img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.employee-avatar-wrap { position: relative; width: 48px; height: 48px; display: block; }
.employee-avatar-wrap .presence { position: absolute; z-index: 4; right: 0; bottom: 1px; border: 2px solid #0c1120; }
.avatar-small { width: 30px; height: 30px; flex: 0 0 auto; font-size: .51rem; }

/* Media-rich registry cards */
.asset-excel-panel {
  display: grid;
  grid-template-columns: 54px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid rgba(76, 134, 255, .25);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(76, 134, 255, .16), transparent 42%),
    linear-gradient(135deg, rgba(19, 29, 51, .96), rgba(10, 15, 27, .96));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .16);
}
.asset-excel-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 134, 255, .28);
  border-radius: 14px;
  background: rgba(76, 134, 255, .12);
  color: #8ab4ff;
}
.asset-excel-icon svg { width: 25px; height: 25px; }
.asset-excel-copy { min-width: 0; }
.asset-excel-copy .section-kicker { margin-bottom: 4px; color: #8ab4ff; }
.asset-excel-copy h2 { margin: 0; color: #eef3ff; font-size: .84rem; }
.asset-excel-copy p { max-width: 780px; margin: 5px 0 0; color: var(--muted); font-size: .58rem; line-height: 1.5; }
.asset-excel-template-link {
  margin: 7px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8ab4ff;
  font: inherit;
  font-size: .55rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.asset-excel-template-link:hover { color: #b9d2ff; }
.asset-excel-template-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(138, 180, 255, .75);
  outline-offset: 3px;
}
.asset-excel-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 16px;
}
.asset-excel-actions {
  display: grid;
  grid-template-columns: minmax(190px, 230px) repeat(3, max-content);
  align-items: end;
  justify-content: end;
  gap: 8px;
}
.asset-excel-actions .button {
  min-height: 36px;
  white-space: nowrap;
}
.asset-import-format-control {
  min-width: 190px;
  display: grid;
  gap: 4px;
  align-content: end;
}
.asset-import-format-control > span {
  color: #9eabd0;
  font-size: .5rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.asset-import-format-control select {
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid rgba(138, 180, 255, .28);
  border-radius: 9px;
  background-color: rgba(8, 14, 26, .82);
  color: #eef3ff;
  font: inherit;
  font-size: .59rem;
}
.asset-import-format-control select:focus-visible {
  outline: 2px solid rgba(138, 180, 255, .75);
  outline-offset: 2px;
}

.asset-import-preview-modal {
  width: min(1100px, calc(100vw - 32px));
  max-height: min(92vh, 920px);
}
.asset-import-preview-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
}
.asset-import-format-summary {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid rgba(76, 134, 255, .22);
  border-radius: 11px;
  background: rgba(76, 134, 255, .07);
}
.asset-import-format-summary strong { color: #dce8ff; font-size: .62rem; }
.asset-import-format-summary span { color: #9eabd0; font-size: .56rem; line-height: 1.5; }
.asset-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 9px;
}
.asset-import-summary > * {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(128, 103, 255, .14);
  border-radius: 11px;
  background: rgba(128, 103, 255, .07);
}
.asset-import-summary strong { color: #f5f2ff; font-size: 1.08rem; }
.asset-import-summary span,
.asset-import-summary small { color: var(--muted); font-size: .55rem; line-height: 1.35; }
.asset-import-sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(13, 18, 32, .76);
}
.asset-import-sheet-row > label,
.asset-import-sheet-row > span { color: var(--muted); font-size: .58rem; }
.asset-import-sheet-row select {
  min-width: min(360px, 100%);
  margin-left: auto;
}
.asset-import-table-wrap {
  max-width: 100%;
  max-height: min(48vh, 480px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 12, 22, .82);
  overscroll-behavior: contain;
}
.asset-import-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .56rem;
}
.asset-import-table th,
.asset-import-table td {
  max-width: 260px;
  padding: 9px 11px;
  border-right: 1px solid rgba(255, 255, 255, .045);
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  overflow: hidden;
  color: var(--muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-import-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #151b2d;
  color: #e8e4fa;
  font-weight: 720;
}
.asset-import-table tr:last-child td { border-bottom: 0; }
.asset-import-table th:last-child,
.asset-import-table td:last-child { border-right: 0; }
.asset-import-warnings {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(246, 179, 76, .22);
  border-radius: 11px;
  background: rgba(246, 179, 76, .07);
  color: #d9c59f;
  font-size: .57rem;
  line-height: 1.45;
}
.asset-import-warnings ul { display: grid; gap: 5px; margin: 0; padding-left: 18px; }

.asset-import-batches-modal {
  width: min(820px, calc(100vw - 32px));
  max-height: min(90vh, 820px);
}
.asset-import-batches-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}
.asset-import-batch-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(128, 103, 255, .16);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(18, 24, 42, .94), rgba(10, 14, 26, .96));
}
.asset-import-batch-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 103, 255, .22);
  border-radius: 11px;
  background: rgba(128, 103, 255, .1);
  color: #aa96ff;
}
.asset-import-batch-icon svg { width: 20px; height: 20px; }
.asset-import-batch-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.asset-import-batch-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.asset-import-batch-title strong {
  min-width: 0;
  overflow: hidden;
  color: #f4f1ff;
  font-size: .65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-import-batch-format {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(76, 134, 255, .24);
  border-radius: 999px;
  background: rgba(76, 134, 255, .08);
  color: #a8c4ff;
  font-size: .48rem;
  font-weight: 760;
}
.asset-import-batch-main > small { color: var(--muted); font-size: .53rem; }
.asset-import-batch-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: #9eabd0;
  font-size: .51rem;
}
.asset-import-batch-metrics b { color: #e8e4fa; }
.asset-import-batch-status {
  width: max-content;
  max-width: 100%;
  color: #9eabd0;
  font-size: .51rem;
}
.asset-import-batch-status.is-success { color: #6be0a6; }
.asset-import-batch-status.is-warning { color: #f6c36f; }
.asset-import-batch-status.is-danger { color: #ff8f9c; }
.asset-import-batches-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: .58rem;
}
.asset-import-batches-loading i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(128, 103, 255, .2);
  border-top-color: #927dff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@media (max-width: 1100px) {
  .asset-excel-panel {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
  }
  .asset-excel-icon { width: 48px; height: 48px; }
  .asset-excel-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(128px, max-content));
    justify-content: flex-start;
  }
  .asset-import-format-control { min-width: 0; }
  .asset-import-summary { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}

@media (max-width: 600px) {
  .asset-excel-panel {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }
  .asset-excel-icon { width: 42px; height: 42px; border-radius: 12px; }
  .asset-excel-icon svg { width: 21px; height: 21px; }
  .asset-excel-copy h2 { font-size: .78rem; }
  .asset-excel-actions {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .asset-import-format-control { grid-column: 1 / -1; }
  .asset-excel-actions .button { width: 100%; padding-inline: 11px; }
  .asset-excel-actions .asset-import-history-button { grid-column: 1 / -1; }
  .asset-import-preview-modal {
    width: calc(100vw - 12px);
    max-height: 96dvh;
  }
  .asset-import-preview-body { gap: 11px; padding: 12px; }
  .asset-import-summary { gap: 7px; }
  .asset-import-summary > * { padding: 10px; }
  .asset-import-sheet-row {
    display: grid;
    align-items: stretch;
    gap: 7px;
    padding: 10px;
  }
  .asset-import-sheet-row select {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .asset-import-table-wrap { max-height: 46vh; }
  .asset-import-table { min-width: 760px; }
  .asset-import-table th,
  .asset-import-table td { padding: 8px 9px; }
  .asset-import-batches-modal { width: calc(100vw - 12px); }
  .asset-import-batches-body { padding: 12px; }
  .asset-import-batch-card {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
  }
  .asset-import-batch-icon { width: 38px; height: 38px; }
  .asset-import-batch-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .asset-excel-panel { grid-template-columns: 1fr; }
  .asset-import-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  #topbarSyncButton { display: none; }
  .asset-excel-actions { grid-template-columns: 1fr; }
  .asset-import-format-control { grid-column: auto; }
}

.asset-date-filter-bar {
  justify-content: flex-start;
  padding-block: 10px;
}
.asset-date-filter-copy {
  min-width: 148px;
  display: grid;
  gap: 3px;
  padding-inline: 3px 7px;
}
.asset-date-filter-copy strong { color: #e3e5ed; font-size: .65rem; }
.asset-date-filter-copy small { color: var(--muted-2); font-size: .51rem; }
.asset-date-filter-bar .date-filter {
  min-width: 158px;
  min-height: 40px;
  flex: 0 1 180px;
  border-radius: 9px;
  background: #0b101d;
}
.asset-date-filter-bar .date-filter:focus-within {
  border-color: rgba(128, 103, 255, .55);
  box-shadow: 0 0 0 3px rgba(128, 103, 255, .08);
}
.asset-date-filter-bar .date-filter input {
  width: 100%;
  outline: 0;
  color-scheme: dark;
  font-size: .64rem;
}
.asset-sort-filter {
  min-width: 268px;
  display: grid;
  gap: 4px;
  margin-left: auto;
}
.asset-sort-filter > span {
  color: var(--muted-2);
  font-size: .49rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.asset-date-filter-bar .asset-sort-filter select { width: 100%; }
.asset-day-groups { min-width: 0; display: grid; gap: 26px; }
.asset-day-group {
  min-width: 0;
  display: grid;
  gap: 12px;
  scroll-margin-top: calc(var(--topbar) + 12px);
}
.asset-day-heading {
  position: sticky;
  z-index: 12;
  top: calc(var(--topbar) + 8px);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 10px 14px 10px 17px;
  border: 1px solid rgba(151, 161, 196, .17);
  border-radius: 13px;
  background: rgba(12, 17, 30, .96);
  box-shadow: 0 12px 28px rgba(2, 4, 10, .25);
  backdrop-filter: blur(18px);
}
.asset-day-heading::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--violet-bright), var(--blue));
  content: "";
}
.asset-day-heading > div { min-width: 0; display: grid; gap: 3px; }
.asset-day-heading span {
  color: var(--muted-2);
  font-size: .49rem;
  font-weight: 740;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.asset-day-heading h2 {
  overflow: hidden;
  margin: 0;
  color: #f0f1f7;
  font-size: .82rem;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-day-heading > strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(128, 103, 255, .2);
  border-radius: 999px;
  background: rgba(128, 103, 255, .1);
  color: #c7bdff;
  font-size: .55rem;
}

.asset-catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}
.asset-catalog-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(17, 23, 40, .96), rgba(9, 13, 24, .96));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.asset-catalog-card:hover { transform: translateY(-2px); border-color: rgba(128, 103, 255, .34); box-shadow: 0 20px 42px rgba(0, 0, 0, .22); }
.asset-card-open { position: relative; width: 100%; display: block; padding: 0; border: 0; background: transparent; text-align: left; }
.asset-media {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 18%, rgba(128, 103, 255, .26), transparent 34%),
    linear-gradient(145deg, #171d31, #0c111f);
}
.asset-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(4, 7, 13, .7)); pointer-events: none; }
.asset-media img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.asset-media img[hidden] { display: none; }
.asset-media-fallback { z-index: 1; display: grid; place-items: center; gap: 9px; color: rgba(209, 201, 255, .78); }
.asset-media-fallback svg { width: 44px; height: 44px; }
.asset-media-fallback small { max-width: 170px; overflow: hidden; color: rgba(194, 199, 216, .6); font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
.asset-media.category-it { background: radial-gradient(circle at 65% 20%, rgba(76, 134, 255, .32), transparent 36%), linear-gradient(145deg, #142037, #09101f); }
.asset-media.category-engineering { background: radial-gradient(circle at 65% 20%, rgba(243, 171, 61, .24), transparent 36%), linear-gradient(145deg, #292119, #0d111c); }
.asset-media.category-transport { background: radial-gradient(circle at 65% 20%, rgba(77, 213, 145, .25), transparent 36%), linear-gradient(145deg, #122a28, #09121b); }
.asset-media.category-furniture { background: radial-gradient(circle at 65% 20%, rgba(179, 121, 255, .25), transparent 36%), linear-gradient(145deg, #281d34, #0b101c); }
.asset-card-media { width: 100%; height: 178px; }
.asset-card-status { position: absolute; z-index: 4; right: 12px; bottom: 11px; }
.asset-card-body { display: grid; gap: 5px; padding: 15px 16px 14px; }
.asset-card-category { color: var(--violet-bright); font-size: .5rem; font-weight: 730; letter-spacing: .08em; text-transform: uppercase; }
.asset-card-body h2 { overflow: hidden; margin: 2px 0 0; color: #e7e8ef; font-size: .77rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-body > p { margin: 0 0 7px; color: var(--muted); font-size: .55rem; }
.asset-card-reconciliation { min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0 0 5px; }
.asset-card-reconciliation small { min-width: 0; overflow: hidden; color: var(--muted-2); font-size: .5rem; text-overflow: ellipsis; white-space: nowrap; }
.inventory-check-badge { flex: 0 0 auto; }
.asset-card-body dl { display: grid; gap: 7px; margin: 0; }
.asset-card-body dl > div { display: grid; grid-template-columns: minmax(90px, .72fr) minmax(0, 1fr); gap: 9px; padding-top: 7px; border-top: 1px solid rgba(151, 161, 196, .07); }
.asset-card-body dt { color: var(--muted-2); font-size: .5rem; }
.asset-card-body dd { overflow: hidden; margin: 0; color: #c8ccd7; font-size: .55rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.asset-catalog-card > footer { display: flex; gap: 8px; margin-top: auto; padding: 0 14px 14px; }
.asset-catalog-card > footer .button { flex: 1; }
.asset-catalog-card > footer .icon-button { flex: 0 0 38px; }
.asset-catalog.is-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.asset-catalog.is-list .asset-catalog-card {
  min-height: 116px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) minmax(216px, auto);
  align-items: stretch;
}
.asset-catalog.is-list .asset-catalog-card:hover { transform: none; }
.asset-catalog.is-list .asset-card-visual {
  min-width: 0;
  height: 100%;
  border-right: 1px solid rgba(151, 161, 196, .08);
}
.asset-catalog.is-list .asset-card-visual .asset-card-open {
  height: 100%;
  min-height: 116px;
}
.asset-catalog.is-list .asset-card-media {
  width: 100%;
  height: 100%;
  min-height: 116px;
}
.asset-catalog.is-list .asset-media-fallback { gap: 5px; }
.asset-catalog.is-list .asset-media-fallback svg { width: 30px; height: 30px; }
.asset-catalog.is-list .asset-media-fallback small { max-width: 94px; font-size: .46rem; }
.asset-catalog.is-list .asset-card-status { right: 7px; bottom: 7px; }
.asset-catalog.is-list .asset-card-status .badge { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-catalog.is-list .asset-quick-photo { top: 7px; right: 7px; width: 30px; height: 30px; border-radius: 8px; }
.asset-catalog.is-list .asset-card-body {
  min-width: 0;
  grid-template-columns: minmax(190px, 1.1fr) minmax(250px, .9fr);
  grid-template-rows: auto auto auto 1fr;
  align-content: center;
  column-gap: 18px;
  padding: 13px 16px;
}
.asset-catalog.is-list .asset-card-category,
.asset-catalog.is-list .asset-card-body > h2,
.asset-catalog.is-list .asset-card-body > p,
.asset-catalog.is-list .asset-card-reconciliation { grid-column: 1; }
.asset-catalog.is-list .asset-card-body > h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: .72rem;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.asset-catalog.is-list .asset-card-body > p { margin-bottom: 2px; }
.asset-catalog.is-list .asset-card-reconciliation { margin: 1px 0 0; }
.asset-catalog.is-list .asset-card-body dl {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  gap: 6px;
}
.asset-catalog.is-list .asset-card-body dl > div { padding-top: 5px; }
.asset-catalog.is-list .asset-catalog-card > footer {
  align-items: center;
  align-self: stretch;
  margin: 0;
  padding: 12px;
  border-left: 1px solid rgba(151, 161, 196, .08);
}
.asset-catalog.is-list .asset-catalog-card > footer .button { min-width: 126px; }
.employee-info { min-width: 0; display: grid; gap: 4px; }
.employee-info h3 { overflow: hidden; margin: 0; color: #e2e4eb; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.employee-info p, .employee-info small { margin: 0; color: var(--muted); font-size: .56rem; }
.employee-stats, .card-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 4px; }
.employee-stats div, .card-stats div { display: grid; gap: 3px; padding: 9px; border-radius: 8px; background: rgba(151, 161, 196, .045); }
.employee-stats span, .card-stats span { color: var(--muted-2); font-size: .48rem; }
.employee-stats strong, .card-stats strong { font-size: .65rem; }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 15px; bottom: 15px; left: 18px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; padding: 11px 0; }
.timeline-marker { z-index: 1; width: 10px; height: 10px; align-self: start; justify-self: center; margin-top: 5px; border: 2px solid currentColor; border-radius: 50%; background: #0c111f; }
.timeline-item strong { color: #dadee7; font-size: .65rem; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: .57rem; line-height: 1.5; }
.timeline-item time { color: var(--muted-2); font-size: .52rem; white-space: nowrap; }

/* Analytics, incidents, reports and settings */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.analytics-grid > .dashboard-panel { grid-column: span 6; }
.analytics-grid > .dashboard-panel.wide { grid-column: span 8; }
.analytics-grid > .dashboard-panel.narrow { grid-column: span 4; }
.analytics-grid > .dashboard-panel.full { grid-column: 1 / -1; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 11px; }
.metric-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(17, 23, 40, .92), rgba(9, 13, 24, .92));
}
.metric-card > span { color: var(--muted); font-size: .6rem; }
.metric-card > strong { font-size: 1.45rem; letter-spacing: -.04em; }
.metric-card > small { color: var(--muted-2); font-size: .53rem; }
.insight-list { display: grid; gap: 9px; }
.insight-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(128, 103, 255, .16);
  border-radius: 11px;
  background: rgba(128, 103, 255, .055);
}
.insight-card > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(128, 103, 255, .12); color: var(--violet-bright); }
.insight-card strong { color: #e0e1ea; font-size: .67rem; }
.insight-card p { margin: 4px 0 0; color: var(--muted); font-size: .56rem; line-height: 1.5; }
.severity-high { border-left: 3px solid var(--red); }
.severity-medium { border-left: 3px solid var(--amber); }
.severity-low { border-left: 3px solid var(--blue); }
.incident-card { display: grid; gap: 13px; }
.incident-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); opacity: .8; }
.incident-meta, .report-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .55rem; }
.incident-meta span, .report-meta span { display: inline-flex; align-items: center; gap: 5px; }
.incident-actions, .report-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 11px; border-top: 1px solid rgba(151, 161, 196, .08); }
.report-card { min-height: 190px; display: flex; flex-direction: column; }
.report-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 11px;
  background: rgba(128, 103, 255, .1);
  color: var(--violet-bright);
}
.report-card h3 { margin: 0; color: #e2e3eb; font-size: .76rem; }
.report-card > p { margin: 7px 0 14px; color: var(--muted); font-size: .58rem; line-height: 1.55; }
.report-card .report-actions { margin-top: auto; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.settings-nav {
  align-self: start;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(13, 18, 32, .86);
}
.settings-nav button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .64rem;
  text-align: left;
}
.settings-nav button:hover { color: #dde0e8; background: rgba(255, 255, 255, .025); }
.settings-nav button.active { border-color: rgba(128, 103, 255, .24); background: rgba(128, 103, 255, .1); color: #c5bbff; }
.settings-content { display: grid; gap: 13px; }
.settings-card h2 { margin: 0 0 6px; font-size: .86rem; }
.settings-card > p { margin: 0 0 18px; color: var(--muted); font-size: .62rem; line-height: 1.55; }
.setting-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid rgba(151, 161, 196, .08);
}
.setting-row > div { display: grid; gap: 4px; }
.setting-row strong { color: #dfe1e9; font-size: .67rem; }
.setting-row small { color: var(--muted); font-size: .55rem; }
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 99px;
  background: #262c3e;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #929aac; transition: transform .18s, background .18s; }
.switch.active { background: rgba(128, 103, 255, .42); }
.switch.active::after { transform: translateX(18px); background: #d3ccff; }

/* AI assistant */
.ai-layout {
  min-height: calc(100vh - var(--topbar) - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
}
.ai-chat {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 70% 0, rgba(128, 103, 255, .12), transparent 36%),
    rgba(10, 14, 26, .9);
}
.ai-chat-head { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ai-chat-head > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #6d52ee, #456ae1); box-shadow: 0 0 24px rgba(128, 103, 255, .24); }
.ai-chat-head h2 { margin: 0; font-size: .79rem; }
.ai-chat-head p { margin: 3px 0 0; color: var(--muted); font-size: .55rem; }
.chat-messages { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; padding: 22px; }
.chat-message { max-width: min(76%, 720px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px 13px 13px; background: rgba(21, 27, 45, .9); color: #cbd0dc; font-size: .67rem; line-height: 1.62; }
.chat-message.user { align-self: flex-end; border-color: rgba(128, 103, 255, .27); border-radius: 13px 4px 13px 13px; background: rgba(128, 103, 255, .13); color: #e6e2ff; }
.chat-message strong { color: #f0eff8; }
.chat-message time { display: block; margin-top: 6px; color: var(--muted-2); font-size: .5rem; }
.chat-composer { display: flex; align-items: flex-end; gap: 9px; padding: 13px; border-top: 1px solid var(--line); background: rgba(7, 10, 19, .68); }
.chat-composer textarea { min-height: 43px; max-height: 130px; flex: 1; resize: vertical; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #0d1220; color: #e5e7ed; font-size: .66rem; }
.chat-composer textarea:focus { border-color: rgba(128, 103, 255, .52); }
.ai-suggestions { align-self: start; display: grid; gap: 12px; }
.suggestion-card {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(128, 103, 255, .18);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(25, 22, 52, .82), rgba(12, 16, 29, .9));
}
.suggestion-card strong { color: #dfdafa; font-size: .67rem; }
.suggestion-card p { margin: 0; color: var(--muted); font-size: .56rem; line-height: 1.5; }
.suggestion-card small { color: var(--green); font-size: .54rem; }

/* Exact dynamic screens */
.compact-kpis { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.filter-label { color: var(--muted-2); font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.task-column > header {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.task-column > header h2 { flex: 1; margin: 0; font-size: .7rem; }
.task-column > header b { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: rgba(151, 161, 196, .08); color: var(--muted); font-size: .55rem; }
.column-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.task-column-list { display: grid; gap: 9px; padding: 10px; }
.column-empty { margin: 30px 10px; color: var(--muted-2); font-size: .58rem; text-align: center; }
.task-card {
  --task-priority-rgb: 128, 103, 255;
  --task-priority-color: #ae9cff;
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--task-priority-rgb), .62);
  background:
    linear-gradient(145deg, rgba(var(--task-priority-rgb), .13), rgba(var(--task-priority-rgb), .035) 42%, rgba(13, 17, 30, .96) 78%),
    #0d111e;
  box-shadow:
    inset 0 0 0 1px rgba(var(--task-priority-rgb), .08),
    0 10px 26px rgba(0, 0, 0, .2),
    0 0 18px rgba(var(--task-priority-rgb), .06);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.task-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  border: 1px solid rgba(var(--task-priority-rgb), .4);
  border-radius: inherit;
  background: linear-gradient(105deg, rgba(var(--task-priority-rgb), .08), transparent 46%);
  pointer-events: none;
}
.task-card.task-priority-low { --task-priority-rgb: 76, 134, 255; --task-priority-color: #82a8ff; }
.task-card.task-priority-medium { --task-priority-rgb: 128, 103, 255; --task-priority-color: #b3a3ff; }
.task-card.task-priority-high { --task-priority-rgb: 243, 171, 61; --task-priority-color: #f3bd69; }
.task-card.task-priority-critical {
  --task-priority-rgb: 255, 95, 114;
  --task-priority-color: #ff8997;
  border-color: rgba(var(--task-priority-rgb), .76);
  box-shadow:
    inset 0 0 0 1px rgba(var(--task-priority-rgb), .14),
    0 10px 28px rgba(0, 0, 0, .22),
    0 0 22px rgba(var(--task-priority-rgb), .12);
}
.task-card:hover {
  border-color: rgba(var(--task-priority-rgb), .94);
  box-shadow:
    inset 0 0 0 1px rgba(var(--task-priority-rgb), .16),
    0 13px 30px rgba(0, 0, 0, .24),
    0 0 25px rgba(var(--task-priority-rgb), .14);
  transform: translateY(-2px);
}
.task-card:focus-within {
  border-color: var(--task-priority-color);
  box-shadow:
    0 0 0 3px rgba(var(--task-priority-rgb), .2),
    inset 0 0 0 1px rgba(var(--task-priority-rgb), .18),
    0 13px 30px rgba(0, 0, 0, .24);
}
.task-card:hover::before,.task-card:focus-within::before { border-color: rgba(var(--task-priority-rgb), .7); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-actions { display: flex; align-items: center; gap: 2px; }
.task-card-actions > button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); }
.task-card-actions > button:hover { background: rgba(255,255,255,.04); color: #e4e6ec; }
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(151,161,196,.16);
  border-radius: 6px;
  background: rgba(151,161,196,.06);
  color: var(--muted);
  font-size: .5rem;
  font-weight: 700;
  white-space: nowrap;
}
.priority-low { border-color: rgba(76,134,255,.2); color: #78a0ff; }
.priority-medium, .priority-normal { border-color: rgba(128,103,255,.22); color: #ae9cff; }
.priority-high { border-color: rgba(243,171,61,.25); color: #efb45a; }
.priority-critical { border-color: rgba(255,95,114,.27); background: rgba(255,95,114,.07); color: #ff8190; }
.task-card-title { padding: 0; border: 0; background: transparent; color: #e3e5eb; font-size: .69rem; font-weight: 700; line-height: 1.45; text-align: left; }
.task-card-title:hover { color: #beb2ff; }
.task-card .progress-wrap { gap: 5px; }
.task-card .progress-track { height: 5px; }
.task-card-meta { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 8px; }
.task-card-meta .avatar { width: 30px; height: 30px; font-size: .48rem; }
.task-card-meta > span:last-child { min-width: 0; display: grid; gap: 2px; }
.task-card-meta strong { overflow: hidden; color: #cbd0db; font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
.task-card-meta small { color: var(--muted-2); font-size: .49rem; }
.task-card[data-task-status="overdue"] .task-card-meta small { color: #ff8997; }
.task-card[data-task-status="done"] .task-card-meta small { color: #70dca5; }
.task-complete { min-height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(77,213,145,.18); border-radius: 8px; background: rgba(77,213,145,.06); color: #70dca5; font-size: .54rem; }
.task-complete:hover { background: rgba(77,213,145,.11); }

.employee-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 13px; }
.employee-card { display: grid; grid-template-columns: 1fr; gap: 14px; }
.employee-card-head { display: grid; grid-template-columns: 48px minmax(0,1fr) 30px; align-items: center; gap: 11px; }
.employee-card-head > div { min-width: 0; }
.employee-card-head h2 { overflow: hidden; margin: 0; color: #e2e4eb; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.employee-card-head p { margin: 4px 0 0; color: var(--muted); font-size: .55rem; }
.employee-card-head > button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted-2); }
.employee-card-head > button:hover { border-color: var(--line); color: #e0e2e9; }
.employee-avatar { position: relative; }
.avatar-1 { background: linear-gradient(145deg, #1c4961, #182741); }
.avatar-2 { background: linear-gradient(145deg, #633148, #29203f); }
.avatar-3 { background: linear-gradient(145deg, #3d5330, #182d31); }
.avatar-4 { background: linear-gradient(145deg, #5c4125, #32243e); }
.presence { position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border: 2px solid #111725; border-radius: 50%; background: #687083; }
.presence-online { background: var(--green); box-shadow: 0 0 7px rgba(77,213,145,.6); }
.presence-busy { background: var(--amber); }
.employee-department { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 8px; background: rgba(151,161,196,.045); color: var(--muted); font-size: .55rem; }
.employee-department svg { width: 14px; height: 14px; color: var(--violet-bright); }
.employee-card .progress-label { font-size: .55rem; }
.employee-stats { margin: 0; }
.employee-stats dt { color: var(--muted-2); font-size: .48rem; }
.employee-stats dd { margin: 2px 0 0; color: #dde0e8; font-size: .65rem; font-weight: 700; }
.employee-contacts { min-height: 36px; display: grid; gap: 4px; color: var(--muted-2); font-size: .52rem; }
.employee-contacts a:hover { color: #b9adff; }

.department-directory-panel {
  overflow: hidden;
  border: 1px solid rgba(128,103,255,.2);
  border-radius: 15px;
  background:
    linear-gradient(135deg,rgba(128,103,255,.045),transparent 45%),
    rgba(8,12,23,.72);
}
.department-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(128,103,255,.13);
}
.department-directory-head > div { min-width: 0; }
.department-directory-head h2 { margin: 3px 0 0; color: #e8e7ee; font-size: .82rem; }
.department-directory-head p { max-width: 720px; margin: 6px 0 0; color: var(--muted); font-size: .56rem; line-height: 1.5; }
.department-directory-head > .button { flex: 0 0 auto; }
.department-directory-access-note {
  max-width: 240px;
  padding: 7px 10px;
  border: 1px solid rgba(151,161,196,.12);
  border-radius: 8px;
  color: var(--muted-2);
  font-size: .51rem;
  line-height: 1.4;
  text-align: right;
}
.department-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(320px,100%),1fr));
  gap: 10px;
  padding: 12px;
}
.department-directory-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 5px minmax(0,1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(151,161,196,.11);
  border-radius: 12px;
  background: rgba(4,8,16,.58);
}
.department-directory-card:hover { border-color: rgba(128,103,255,.28); background: rgba(128,103,255,.035); }
.department-directory-card.is-inactive { opacity: .72; }
.department-directory-accent {
  align-self: stretch;
  min-height: 70px;
  border-radius: 99px;
  background: var(--department-color,#8067ff);
  box-shadow: 0 0 14px color-mix(in srgb,var(--department-color,#8067ff) 35%,transparent);
}
.department-directory-accent.department-color-0 { --department-color: #8067ff; }
.department-directory-accent.department-color-1 { --department-color: #4c86ff; }
.department-directory-accent.department-color-2 { --department-color: #4dd591; }
.department-directory-accent.department-color-3 { --department-color: #f2b766; }
.department-directory-accent.department-color-4 { --department-color: #ff5f72; }
.department-directory-accent.department-color-5 { --department-color: #45c6d8; }
.department-directory-copy { min-width: 0; }
.department-directory-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.department-directory-title h3 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #e4e6ed;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.department-directory-status {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(77,213,145,.18);
  border-radius: 99px;
  background: rgba(77,213,145,.055);
  color: #76dca7;
  font-size: .45rem;
  font-weight: 700;
}
.is-inactive .department-directory-status { border-color: rgba(151,161,196,.15); background: rgba(151,161,196,.055); color: var(--muted); }
.department-directory-copy > p {
  min-height: 2.8em;
  margin: 6px 0 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: .52rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.department-directory-usage { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.department-directory-usage > span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(151,161,196,.065);
  color: var(--muted);
  font-size: .49rem;
}
.department-directory-usage svg { width: 13px; height: 13px; color: var(--violet-bright); }
.department-directory-usage strong { color: #dedfe7; font-size: .55rem; }
.department-directory-lock {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 9px;
  color: #d7ac65;
  font-size: .47rem;
  line-height: 1.4;
}
.department-directory-lock svg { width: 13px; height: 13px; flex: 0 0 auto; }
.department-directory-actions { display: flex; align-items: center; gap: 5px; }
.department-directory-actions .button { min-height: 31px; padding-inline: 9px; }
.department-directory-actions .button svg { width: 13px; height: 13px; }
.department-directory-actions .icon-button { width: 31px; height: 31px; }
.department-directory-actions button:disabled { cursor: not-allowed; opacity: .32; }
.department-directory-readonly { padding: 6px 8px; color: var(--muted-2); font-size: .47rem; white-space: nowrap; }
.department-directory-empty {
  grid-column: 1 / -1;
  min-height: 104px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px dashed rgba(151,161,196,.15);
  border-radius: 12px;
}
.department-directory-empty > svg { width: 30px; height: 30px; color: var(--violet-bright); }
.department-directory-empty h3 { margin: 0; font-size: .66rem; }
.department-directory-empty p { margin: 5px 0 0; color: var(--muted); font-size: .52rem; }
.department-delete-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(243,171,61,.19);
  border-radius: 9px;
  background: rgba(243,171,61,.055);
  color: #d9b678;
  font-size: .52rem;
  line-height: 1.45;
}
.department-delete-warning svg { width: 15px; height: 15px; flex: 0 0 auto; }

.analytics-grid > .analytics-room-panel { grid-column: span 5; }
.analytics-grid > .analytics-cost-panel { grid-column: span 7; }
.analytics-grid > .analytics-incident-panel,
.analytics-grid > .analytics-task-panel { grid-column: span 6; }
.analytics-grid > .analytics-resource-panel,
.analytics-grid > .analytics-insight-panel { grid-column: 1 / -1; }
.route-analytics .dashboard-panel { min-width: 0; }
.route-analytics .kpi-card {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 5px;
}
.route-analytics .kpi-icon { grid-column: 1; grid-row: 1 / span 2; }
.route-analytics .kpi-copy { grid-column: 2; grid-row: 1; }
.route-analytics .kpi-delta {
  position: static;
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 99px;
  background: rgba(151,161,196,.035);
  font-size: .56rem;
  line-height: 1.2;
  opacity: .9;
}
.route-analytics .panel-header h2 { margin-top: 3px; font-size: .88rem; line-height: 1.3; }
.route-analytics .panel-kicker { font-size: .52rem; letter-spacing: .1em; line-height: 1.4; }
.route-analytics .panel-body { padding: 20px; }
.panel-total { display: grid; justify-items: end; gap: 3px; text-align: right; }
.panel-total small { color: var(--muted-2); font-size: .5rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel-total strong { color: #f1eff9; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-lead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.chart-lead strong { font-size: 1.12rem; }
.chart-lead span { font-size: .56rem; }
.completion-ring { min-height: 230px; display: grid; grid-template-columns: 150px minmax(160px,1fr); align-items: center; gap: 24px; }
.completion-ring-graphic { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.completion-ring-graphic svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.completion-ring-track,.completion-ring-value { fill: none; stroke-width: 9; }
.completion-ring-track { stroke: rgba(77,213,145,.1); }
.completion-ring-value { stroke: var(--green); stroke-linecap: round; }
.completion-ring-graphic > span { position: relative; display: grid; place-items: center; gap: 3px; }
.completion-ring strong { font-size: 1.25rem; }
.completion-ring small { color: var(--muted); font-size: .56rem; }
.task-breakdown { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.task-breakdown li {
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) auto 34px;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  border-bottom: 1px solid rgba(151,161,196,.08);
  color: var(--muted);
  font-size: .63rem;
}
.task-breakdown li:last-child { border-bottom: 0; }
.task-breakdown strong { color: #e2e4ec; font-size: .66rem; font-variant-numeric: tabular-nums; }
.task-breakdown small { color: var(--muted-2); font-size: .54rem; text-align: right; font-variant-numeric: tabular-nums; }
.task-breakdown-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.resource-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(220px,1fr)); gap: 12px; }
.resource-metric {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 46px auto;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(151,161,196,.12);
  border-radius: 13px;
  background: rgba(151,161,196,.025);
}
.resource-metric > header { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; }
.resource-metric > header > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.resource-metric > header strong { display: block; color: #e2e4ec; font-size: .68rem; }
.resource-metric > header small { display: block; margin-top: 3px; color: var(--muted-2); font-size: .52rem; line-height: 1.35; }
.resource-metric.tone-energy { color: #f0b253; }
.resource-metric.tone-water { color: #62b8ff; }
.resource-metric.tone-heat { color: #ff8176; }
.resource-metric.tone-other { color: var(--violet-bright); }
.resource-metric.is-empty { color: var(--muted-2); }
.resource-value { display: flex; align-items: baseline; gap: 6px; color: #f0f1f6; }
.resource-value strong { font-size: 1.28rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.resource-value span { color: var(--muted); font-size: .58rem; }
.resource-spark { width: 100%; height: 46px; display: block; overflow: visible; }
.resource-spark rect { fill: currentColor; opacity: .78; }
.resource-spark line { stroke: rgba(151,161,196,.14); stroke-width: 1; vector-effect: non-scaling-stroke; }
.resource-spark.is-empty line { stroke-dasharray: 4 4; }
.resource-metric > p { margin: 0; color: var(--muted-2); font-size: .51rem; line-height: 1.45; }
.insight-list { margin: 0; padding: 0; list-style: none; }
.insight-list li { display: grid; grid-template-columns: 38px minmax(0,1fr) 30px; align-items: center; gap: 12px; padding: 13px 11px; border-bottom: 1px solid rgba(151,161,196,.08); }
.insight-list li:last-child { border-bottom: 0; }
.insight-list li > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(128,103,255,.1); color: var(--violet-bright); }
.insight-list li > div { min-width: 0; }
.insight-list strong { color: #dfe1e9; font-size: .67rem; }
.insight-list p { margin: 4px 0; color: var(--muted); font-size: .57rem; line-height: 1.5; }
.insight-list small { color: var(--green); font-size: .53rem; }
.insight-list button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }

.quick-export-grid { display: grid; grid-template-columns: repeat(4, minmax(170px,1fr)); gap: 10px; }
.export-tile { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(151,161,196,.025); text-align: left; }
.export-tile:hover { border-color: rgba(128,103,255,.3); background: rgba(128,103,255,.05); }
.export-tile > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(128,103,255,.1); color: var(--violet-bright); }
.export-tile > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.export-tile strong { overflow: hidden; color: #dfe1e8; font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.export-tile small { color: var(--muted); font-size: .49rem; }
.export-tile > svg { color: var(--muted-2); }
.report-card { min-height: 175px; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 13px; }
.report-card .report-icon { margin: 0; }
.report-card-copy { min-width: 0; }
.report-card-copy h2 { margin: 5px 0; color: #e1e3ea; font-size: .74rem; line-height: 1.4; }
.report-card-copy p { margin: 0 0 10px; color: var(--muted); font-size: .53rem; }
.report-card .report-actions { grid-column: 1 / -1; margin-top: auto; }

.ai-page { min-height: calc(100vh - var(--topbar) - 70px); display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 16px; }
.ai-command { min-height: 630px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 75% 0, rgba(128,103,255,.15), transparent 40%), rgba(10,14,26,.9); }
.ai-command-head { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 18px; border-bottom: 1px solid var(--line); }
.ai-command-head h1 { margin: 3px 0; font-size: .95rem; }
.ai-command-head p { margin: 0; color: var(--muted); font-size: .56rem; }
.ai-orb { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg,#7356f2,#426ee2); color: white; box-shadow: 0 0 28px rgba(128,103,255,.3); }
.ai-online { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .53rem; }
.ai-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(77,213,145,.6); }
.ai-status { min-width: 190px; max-width: 270px; display: grid; justify-items: end; gap: 5px; text-align: right; }
.ai-status > span { display: inline-flex; align-items: center; gap: 7px; color: #d9dce5; font-size: .55rem; font-weight: 700; }
.ai-status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--muted-2); }
.ai-status small { color: var(--muted-2); font-size: .48rem; line-height: 1.45; }
.ai-status.tone-online i { background: var(--green); box-shadow: 0 0 8px rgba(77,213,145,.6); }
.ai-status.tone-checking i { background: var(--blue); box-shadow: 0 0 8px rgba(76,134,255,.55); }
.ai-status.tone-quota i { background: var(--orange); box-shadow: 0 0 8px rgba(242,183,102,.45); }
.ai-status.tone-offline i,.ai-status.tone-disabled i,.ai-status.tone-unavailable i { background: var(--muted-2); }
.ai-fallback-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 13px 16px 0; padding: 11px 13px; border: 1px solid rgba(242,183,102,.18); border-radius: 11px; background: rgba(242,183,102,.055); }
.ai-fallback-note > div { min-width: 0; display: grid; gap: 3px; }
.ai-fallback-note strong { color: #e6d7b9; font-size: .57rem; }
.ai-fallback-note span { color: var(--muted); font-size: .5rem; line-height: 1.45; }
.ai-fallback-note .button { flex: 0 0 auto; }
.ai-history-note { margin: 10px 18px 0; color: var(--muted); font-size: .5rem; }
.ai-conversation { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; padding: 22px; }
.ai-message { max-width: min(82%,720px); display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: start; gap: 9px; }
.ai-message > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(128,103,255,.12); color: var(--violet-bright); font-size: .5rem; font-weight: 800; }
.ai-message > div { padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px 13px 13px; background: rgba(20,26,43,.92); color: #cbd0dc; font-size: .65rem; line-height: 1.6; }
.ai-message > div > p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-message-user { align-self: flex-end; grid-template-columns: minmax(0,1fr) 32px; }
.ai-message-user > span { grid-column: 2; grid-row: 1; }
.ai-message-user > div { grid-column: 1; grid-row: 1; border-color: rgba(128,103,255,.24); border-radius: 13px 4px 13px 13px; background: rgba(128,103,255,.12); }
.ai-message-source { display: block; margin-top: 7px; color: var(--muted-2); font-size: .47rem; }
.ai-message-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ai-message-actions .button { min-height: 32px; padding-inline: 10px; font-size: .5rem; }
.ai-message-pending > div { color: var(--muted); }
.ai-message-pending > div::after { content: ""; display: inline-block; width: 16px; height: 4px; margin-left: 7px; border-radius: 4px; background: linear-gradient(90deg,rgba(128,103,255,.2),rgba(128,103,255,.85),rgba(128,103,255,.2)); animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .35; transform: translateX(3px); } }
.ai-compose { display: flex; align-items: flex-end; gap: 9px; padding: 13px; border-top: 1px solid var(--line); }
.ai-compose textarea { min-height: 45px; max-height: 130px; flex: 1; resize: vertical; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #0b101d; color: #e4e6ec; font-size: .65rem; }
.ai-compose textarea:focus { border-color: rgba(128,103,255,.52); }
.ai-prompts { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 13px 13px; }
.ai-prompts button { min-height: 29px; padding: 0 9px; border: 1px solid rgba(128,103,255,.18); border-radius: 8px; background: rgba(128,103,255,.05); color: #aaa0db; font-size: .5rem; }
.recommendation-list { align-self: start; display: grid; gap: 10px; }
.section-heading.small { min-height: 0; padding: 4px 0 8px; }
.section-heading.small h1 { font-size: 1rem; }
.recommendation-card { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 10px; padding: 14px; border: 1px solid rgba(128,103,255,.18); border-radius: 13px; background: linear-gradient(145deg,rgba(25,22,52,.8),rgba(12,16,29,.9)); }
.recommendation-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(128,103,255,.11); color: var(--violet-bright); }
.recommendation-card small { color: var(--muted-2); font-size: .48rem; text-transform: uppercase; }
.recommendation-card h2 { margin: 5px 0; font-size: .67rem; }
.recommendation-card p { margin: 0 0 7px; color: var(--muted); font-size: .54rem; line-height: 1.5; }
.recommendation-card strong { color: var(--green); font-size: .53rem; }
.recommendation-card > .button { grid-column: 1 / -1; }

.settings-nav > .section-kicker { padding: 9px 10px 5px; }
.settings-section { overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg,rgba(17,23,40,.94),rgba(9,13,24,.94)); }
.settings-section > header { margin-bottom: 16px; }
.settings-section > header h2 { margin: 0 0 5px; font-size: .78rem; }
.settings-section > header p { margin: 0; color: var(--muted); font-size: .56rem; }
.settings-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.settings-fields label { display: grid; gap: 6px; color: var(--muted); font-size: .56rem; }
.settings-fields label.span-2 { grid-column: 1 / -1; }
.settings-fields input { min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #0b101d; color: #d8dbe4; font-size: .64rem; }
.role-grid { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 9px; }
.role-grid > div { display: grid; gap: 6px; padding: 13px; border: 1px solid rgba(151,161,196,.09); border-radius: 10px; background: rgba(151,161,196,.025); }
.role-grid span { color: var(--violet-bright); }
.role-grid strong { font-size: .62rem; }
.role-grid small { color: var(--muted); font-size: .51rem; line-height: 1.45; }
.integration-grid { display: grid; grid-template-columns: repeat(2,minmax(220px,1fr)); gap: 9px; }
.integration-card { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(151,161,196,.09); border-radius: 10px; background: rgba(151,161,196,.025); }
.integration-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(77,213,145,.08); color: var(--green); }
.integration-card h3 { margin: 0 0 3px; font-size: .61rem; }
.integration-card p { margin: 0; color: var(--muted); font-size: .5rem; line-height: 1.4; }
.notification-settings-content { align-content: start; }
.notification-device-card { display: grid; gap: 15px; }
.notification-device-status { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 13px; }
.notification-device-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--violet-bright); background: rgba(128,103,255,.11); }
.notification-device-icon svg { width: 21px; height: 21px; }
.notification-device-status.tone-success .notification-device-icon { color: var(--green); background: rgba(77,213,145,.11); }
.notification-device-status.tone-danger .notification-device-icon { color: #ff8997; background: rgba(255,95,114,.1); }
.notification-device-status h2 { margin: 3px 0 5px; font-size: .78rem; }
.notification-device-status p { margin: 0; color: var(--muted); font-size: .55rem; line-height: 1.5; }
.notification-permission-badge { min-height: 26px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid rgba(151,161,196,.13); border-radius: 8px; color: #b8bfce; background: rgba(151,161,196,.045); font-size: .49rem; font-weight: 700; white-space: nowrap; }
.notification-device-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.notification-settings-error { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid rgba(255,95,114,.18); border-radius: 9px; color: #ff9ba7; background: rgba(255,95,114,.055); }
.notification-settings-error svg { width: 18px; height: 18px; }
.notification-settings-error p { margin: 0; font-size: .53rem; line-height: 1.45; }
.notification-preference-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.notification-preference { position: relative; min-width: 0; min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid rgba(151,161,196,.09); border-radius: 11px; cursor: pointer; background: rgba(151,161,196,.025); }
.notification-preference:hover { border-color: rgba(128,103,255,.22); background: rgba(128,103,255,.045); }
.notification-preference > span { min-width: 0; display: grid; gap: 4px; }
.notification-preference strong { color: #dfe2e9; font-size: .61rem; }
.notification-preference small { color: var(--muted); font-size: .5rem; line-height: 1.4; }
.notification-preference input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.notification-preference i { position: relative; width: 38px; height: 22px; border: 1px solid rgba(151,161,196,.2); border-radius: 999px; background: rgba(151,161,196,.11); transition: border-color .18s,background .18s; }
.notification-preference i::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #9299aa; box-shadow: 0 2px 6px rgba(0,0,0,.28); transition: transform .18s,background .18s; content: ""; }
.notification-preference input:checked + i { border-color: rgba(128,103,255,.48); background: rgba(128,103,255,.5); }
.notification-preference input:checked + i::after { transform: translateX(16px); background: white; }
.notification-preference:has(input:focus-visible) { border-color: rgba(128,103,255,.62); box-shadow: 0 0 0 3px rgba(128,103,255,.09); }
.notification-preference.is-disabled { cursor: wait; opacity: .62; }
.notification-sound-note { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: start; gap: 11px; }
.notification-sound-note > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--violet-bright); background: rgba(128,103,255,.1); }
.notification-sound-note h2 { margin: 1px 0 5px; font-size: .67rem; }
.notification-sound-note p { margin: 0; color: var(--muted); font-size: .52rem; line-height: 1.55; }
.desktop-application-settings { align-content: start; }
.desktop-application-card { display: grid; gap: 15px; }
.desktop-application-status { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; }
.desktop-application-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--violet-bright); background: rgba(128,103,255,.11); }
.desktop-application-icon svg { width: 22px; height: 22px; }
.desktop-application-status.tone-checking .desktop-application-icon { animation: object360-update-pulse 1.2s ease-in-out infinite; }
.desktop-application-status.tone-available .desktop-application-icon { color: #fff; background: linear-gradient(145deg,#795af1,#436fe8); box-shadow: 0 8px 24px rgba(94,72,229,.22); }
.desktop-application-status.tone-success .desktop-application-icon { color: var(--green); background: rgba(77,213,145,.11); }
.desktop-application-status.tone-danger .desktop-application-icon { color: #ff8997; background: rgba(255,95,114,.1); }
.desktop-application-status h2 { margin: 4px 0 5px; font-size: .8rem; }
.desktop-application-status p { max-width: 720px; margin: 0; color: var(--muted); font-size: .55rem; line-height: 1.55; }
.desktop-version-badge { min-height: 29px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid rgba(128,103,255,.24); border-radius: 9px; color: #c7bdff; background: rgba(128,103,255,.08); font-size: .52rem; font-weight: 800; white-space: nowrap; }
.desktop-application-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.desktop-update-note { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: start; gap: 12px; }
.desktop-update-note > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: rgba(77,213,145,.09); }
.desktop-update-note h2 { margin: 2px 0 6px; font-size: .68rem; }
.desktop-update-note p { margin: 0; color: var(--muted); font-size: .53rem; line-height: 1.6; }
@keyframes object360-update-pulse {
  50% { transform: translateY(-1px); color: #fff; background: rgba(128,103,255,.3); }
}
@media (max-width: 720px) {
  .notification-device-status { grid-template-columns: 42px minmax(0,1fr); }
  .notification-permission-badge { grid-column: 1 / -1; justify-self: start; }
  .notification-device-actions .button { width: 100%; }
  .notification-preference-grid { grid-template-columns: 1fr; }
  .desktop-application-status { grid-template-columns: 44px minmax(0,1fr); }
  .desktop-application-icon { width: 44px; height: 44px; }
  .desktop-version-badge { grid-column: 1 / -1; justify-self: start; }
  .desktop-application-actions .button { width: 100%; }
}
.field-app-promo { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: radial-gradient(circle at 10% 50%,rgba(128,103,255,.15),transparent 36%),rgba(13,18,32,.92); }
.field-app-promo > div { display: flex; align-items: center; gap: 13px; }
.field-app-promo h2 { margin: 4px 0; font-size: .78rem; }
.field-app-promo p { margin: 0; color: var(--muted); font-size: .55rem; }
.field-app-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: linear-gradient(145deg,#6d52ee,#426fe3); color: white; }

/* Account onboarding, invitations and organization members */
.app-shell.account-onboarding .sidebar,
.app-shell.account-onboarding .mobile-nav,
.app-shell.account-onboarding .page-identity,
.app-shell.account-onboarding .global-search-shell,
.app-shell.account-onboarding .quick-create { display: none; }
.app-shell.account-onboarding .workspace { margin-left: 0; }
.app-shell.account-onboarding .topbar { left: 0; justify-content: flex-end; }
.app-shell.account-onboarding .view-host { min-height: calc(100vh - var(--topbar)); display: grid; align-content: center; }
.account-onboarding-page { width: min(980px, 100%); display: grid; gap: 16px; margin: 0 auto; }
.account-onboarding-hero {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(128,103,255,.25);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 35%, rgba(128,103,255,.18), transparent 34%),
    linear-gradient(145deg,rgba(20,24,46,.98),rgba(8,12,23,.98));
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.account-onboarding-mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg,#7659ef,#456fe3); color: white; box-shadow: 0 14px 32px rgba(83,55,203,.28); }
.account-onboarding-mark svg { width: 27px; height: 27px; }
.account-onboarding-hero h1 { margin: 0; font-size: clamp(1.45rem,3vw,2.15rem); letter-spacing: -.04em; }
.account-onboarding-hero p { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.account-invitations-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(11,15,28,.9); }
.account-invitations-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.account-invitations-panel > header h2 { margin: 0; font-size: .86rem; }
.account-invitations-panel > header p { margin: 5px 0 0; color: var(--muted); font-size: .57rem; }
.invitation-total { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(128,103,255,.11); color: var(--violet-bright); font-size: .7rem; font-weight: 750; }
.account-invitations-list,.settings-invitation-list,.pending-invitations-list { display: grid; gap: 9px; padding: 12px; }
.invitation-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(151,161,196,.11);
  border-radius: 12px;
  background: rgba(151,161,196,.025);
}
.invitation-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: rgba(128,103,255,.11); color: var(--violet-bright); }
.invitation-card-copy { min-width: 0; }
.invitation-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.invitation-card-title h3 { min-width: 0; overflow: hidden; margin: 0; color: #e5e7ee; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.invitation-card-copy p { margin: 5px 0 0; color: #abb2c1; font-size: .56rem; line-height: 1.45; }
.invitation-card-copy small { display: block; margin-top: 4px; color: var(--muted-2); font-size: .5rem; }
.invitation-card-copy blockquote { margin: 8px 0 0; padding: 7px 9px; border-left: 2px solid rgba(128,103,255,.35); background: rgba(128,103,255,.045); color: var(--muted); font-size: .53rem; line-height: 1.5; }
.invitation-status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid currentColor; border-radius: 7px; background: rgba(151,161,196,.035); font-size: .48rem; font-weight: 700; white-space: nowrap; }
.invitation-card-actions { display: flex; align-items: center; gap: 7px; }
.invitation-card-actions .button,.invitation-revoke { min-height: 34px; padding-inline: 11px; font-size: .55rem; }
.pending-invitations-panel { overflow: hidden; border: 1px solid rgba(243,171,61,.16); border-radius: 14px; background: rgba(243,171,61,.025); }
.pending-invitations-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid rgba(243,171,61,.1); }
.pending-invitations-panel > header h2 { margin: 0; font-size: .72rem; }
.pending-invitations-panel .pending-invitations-list { grid-template-columns: repeat(auto-fit,minmax(min(330px,100%),1fr)); }
.pending-invitations-panel .invitation-card { background: rgba(9,13,24,.55); }
.employee-handle { color: var(--violet-bright); }
.empty-state-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.linked-account-field { min-height: 46px; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; column-gap: 8px; padding: 8px 11px; border: 1px solid rgba(77,213,145,.18); border-radius: 9px; background: rgba(77,213,145,.045); }
.linked-account-field > svg { grid-row: 1 / span 2; color: var(--green); }
.linked-account-field strong { color: #dce2e5; font-size: .64rem; }
.linked-account-field small { color: var(--muted); font-size: .49rem; }
.settings-section-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-action > div > h2 { margin: 0 0 5px; font-size: .78rem; }
.settings-section-action > div > p { margin: 0; color: var(--muted); font-size: .56rem; }
.users-summary-strip { padding: 10px 16px; }
.users-summary-strip > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.users-summary-strip span { display: grid; gap: 4px; padding: 9px 14px; color: var(--muted); font-size: .52rem; }
.users-summary-strip span + span { border-left: 1px solid var(--line); }
.users-summary-strip strong { color: #e1e4eb; font-size: .78rem; }
.organization-member-list { display: grid; gap: 4px; }
.organization-member-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(150px,1.35fr) minmax(90px,.65fr) minmax(130px,.9fr) auto 34px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(151,161,196,.022);
}
.organization-member-row:hover { border-color: rgba(128,103,255,.16); background: rgba(128,103,255,.035); }
.organization-member-main { min-width: 0; display: grid; gap: 3px; }
.organization-member-main strong,.organization-member-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.organization-member-main strong { color: #dfe2e9; font-size: .61rem; }
.organization-member-main small,.member-department { color: var(--muted); font-size: .5rem; }
.member-role { color: #b9adff; font-size: .52rem; font-weight: 650; }
.organization-member-row > .icon-button { width: 32px; height: 32px; }
.profile-account-card { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 14px; }
.profile-account-card h2 { margin: 0; font-size: .82rem; }
.profile-account-card p { margin: 5px 0 0; color: var(--muted); font-size: .56rem; }

/* Invite account combobox */
.invite-employee-form { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.invite-modal-body { min-height: 0; overflow-y: auto; padding: 18px; }
.invite-search-field { display: grid; gap: 7px; }
.invite-search-field > label,.invite-details-grid > label { color: #aeb5c5; font-size: .61rem; font-weight: 600; }
.invite-search-field > small { color: var(--muted-2); font-size: .51rem; line-height: 1.45; }
.handle-input-shell { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; min-height: 46px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #0b101d; }
.handle-input-shell:focus-within { border-color: rgba(128,103,255,.55); box-shadow: 0 0 0 3px rgba(128,103,255,.08); }
.handle-input-shell > span { display: grid; place-items: center; align-self: stretch; border-right: 1px solid var(--line); color: var(--violet-bright); font-size: .72rem; font-weight: 750; }
.handle-input-shell input { min-width: 0; height: 44px; padding: 0 11px; border: 0; outline: 0; background: transparent; color: #e2e4ea; font-size: .66rem; }
.invite-search-results { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: #090e1a; }
.invite-search-results:empty { display: none; }
.invite-search-results > button { width: 100%; min-height: 54px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-bottom: 1px solid rgba(151,161,196,.07); background: transparent; text-align: left; }
.invite-search-results > button:last-child { border-bottom: 0; }
.invite-search-results > button:not(:disabled):hover { background: rgba(128,103,255,.07); }
.invite-search-results > button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.invite-search-results strong { color: #dfe2ea; font-size: .6rem; }
.invite-search-results small { color: var(--muted); font-size: .49rem; }
.invite-search-results em { color: var(--violet-bright); font-size: .5rem; font-style: normal; }
.invite-search-state { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; color: var(--muted); text-align: center; }
.invite-search-state p { margin: 0; font-size: .53rem; line-height: 1.45; }
.invite-search-state > svg { width: 16px; height: 16px; }
.invite-search-state.is-error { color: #ff8997; }
.invite-search-state.is-loading > span { width: 16px; height: 16px; border: 2px solid rgba(128,103,255,.2); border-top-color: var(--violet-bright); border-radius: 50%; animation: invite-spinner .8s linear infinite; }
@keyframes invite-spinner { to { transform: rotate(360deg); } }
.selected-invite-account { min-height: 54px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid rgba(77,213,145,.2); border-radius: 11px; background: rgba(77,213,145,.045); }
.selected-invite-account > svg { color: var(--green); }
.selected-invite-account > span { min-width: 0; display: grid; gap: 3px; }
.selected-invite-account strong { font-size: .62rem; }
.selected-invite-account small { color: var(--muted); font-size: .49rem; }
.invite-details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.invite-details-grid > label { min-width: 0; display: grid; gap: 6px; }
.invite-details-grid .span-2 { grid-column: 1 / -1; }
.invite-details-grid input,.invite-details-grid select,.invite-details-grid textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #0b101d; color: #e2e4ea; font-size: .64rem; }
.invite-details-grid textarea { min-height: 74px; resize: vertical; line-height: 1.45; }
.invite-details-grid input:focus,.invite-details-grid select:focus,.invite-details-grid textarea:focus { border-color: rgba(128,103,255,.55); box-shadow: 0 0 0 3px rgba(128,103,255,.08); }
.invite-modal-actions { flex: 0 0 auto; margin: 0; }
.organization-create-intro { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 11px; margin-bottom: 15px; padding: 12px; border: 1px solid rgba(128,103,255,.16); border-radius: 11px; background: rgba(128,103,255,.045); }
.organization-create-intro > svg { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(128,103,255,.1); color: var(--violet-bright); }
.organization-create-intro strong { font-size: .64rem; }
.organization-create-intro p { margin: 4px 0 0; color: var(--muted); font-size: .52rem; line-height: 1.45; }

.notification-invitations { display: grid; gap: 8px; padding: 13px 12px; border-bottom: 1px solid var(--line); background: rgba(128,103,255,.025); }
.notification-invitations > .section-kicker { padding: 0 4px; }
.notification-invitations .invitation-card { grid-template-columns: 34px minmax(0,1fr); padding: 10px; background: rgba(8,12,22,.68); }
.notification-invitations .invitation-card-icon { width: 34px; height: 34px; }
.notification-invitations .invitation-card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
.notification-invitations .invitation-card-actions .button { width: 100%; }

.event-icon.success { border-color: rgba(77,213,145,.16); background: rgba(77,213,145,.1); color: var(--green); }
.event-icon.warning { border-color: rgba(243,171,61,.16); background: rgba(243,171,61,.1); color: var(--amber); }
.event-icon.danger { border-color: rgba(255,95,114,.16); background: rgba(255,95,114,.1); color: var(--red); }
.event-icon.info { border-color: rgba(76,134,255,.19); background: linear-gradient(145deg, rgba(76,134,255,.13), rgba(91,78,194,.07)); color: #6f9aff; }
.event-icon.accent { border-color: rgba(128,103,255,.2); background: linear-gradient(145deg, rgba(76,134,255,.08), rgba(128,103,255,.14)); color: var(--violet-bright); }
.event-icon.muted { border-color: rgba(151,161,196,.11); background: rgba(151,161,196,.07); color: var(--muted); }

.modal-open { overflow: hidden; }
.modal-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font-size: .9rem; }
.entity-form { min-height: 0; overflow-y: auto; padding: 18px; }
.entity-form .span-2 { grid-column: 1 / -1; }
.floor-editor-context {
  display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: start; gap: 10px;
  margin: 14px 18px 0; padding: 11px 12px; border: 1px solid rgba(77,213,145,.2); border-radius: 11px;
  background: rgba(77,213,145,.055);
}
.floor-editor-context > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(77,213,145,.1); color: var(--green); }
.floor-editor-context > span svg { width: 17px; height: 17px; }
.floor-editor-context > div { min-width: 0; display: grid; gap: 4px; }
.floor-editor-context strong { color: #dfe6e2; font-size: .62rem; }
.floor-editor-context p { margin: 0; color: var(--muted); font-size: .52rem; line-height: 1.5; }
.floor-editor-context.is-linked { border-color: rgba(243,171,61,.22); background: rgba(243,171,61,.055); }
.floor-editor-context.is-linked > span { background: rgba(243,171,61,.1); color: var(--amber); }
.entity-form select:disabled { cursor: not-allowed; opacity: .68; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 18px -18px -18px; padding: 13px 18px; border-top: 1px solid var(--line); background: rgba(7,10,19,.65); }
.modal-card.asset-editor-modal {
  width: min(1180px, calc(100vw - 40px));
  height: min(88dvh, 900px);
  max-height: min(88dvh, 900px);
}
.asset-editor-modal > .modal-head { flex: 0 0 auto; }
.asset-editor-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, .94fr);
  grid-template-areas: "form media";
  overflow: hidden;
}
.asset-editor-form-panel {
  min-width: 0;
  min-height: 0;
  grid-area: form;
  overflow: hidden;
}
.asset-editor-form-panel > .entity-form {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.asset-editor-form-panel > .entity-form > .modal-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  box-shadow: 0 -12px 30px rgba(3, 5, 12, .28);
}
.asset-editor-media-panel {
  min-width: 0;
  min-height: 0;
  grid-area: media;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 76% 16%, rgba(128, 103, 255, .12), transparent 36%),
    rgba(8, 12, 23, .56);
}
.asset-modal-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(170px, 1.1fr);
  grid-template-areas: "summary photo";
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 20% 50%, rgba(128, 103, 255, .13), transparent 44%);
}
.asset-modal-photo { min-width: 0; grid-area: photo; }
.asset-modal-summary { min-width: 0; grid-area: summary; }
.asset-modal-hero h3 { margin: 5px 0; color: #f0eef8; font-size: .82rem; line-height: 1.32; overflow-wrap: anywhere; }
.asset-modal-hero p { margin: 0 0 10px; color: var(--muted); font-size: .56rem; line-height: 1.4; }
.asset-modal-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.asset-modal-state-badge { display: inline-flex; }
.asset-modal-check-details { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 9px; }
.asset-modal-check-details span { color: #c7cbd7; font-size: .53rem; line-height: 1.4; }
.asset-modal-check-details small { width: 100%; color: var(--muted-2); font-size: .5rem; }
.asset-modal-facts { display: grid; gap: 6px; margin-top: 14px; }
.asset-modal-fact {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(151, 161, 196, .11);
  border-radius: 9px;
  background: rgba(7, 11, 20, .56);
}
.asset-modal-fact-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(128, 103, 255, .09);
  color: #a995ff;
}
.asset-modal-fact-icon svg { width: 14px; height: 14px; }
.asset-modal-fact-copy { min-width: 0; display: grid; gap: 2px; }
.asset-modal-fact-copy small { color: var(--muted-2); font-size: .46rem; line-height: 1.3; }
.asset-modal-fact-copy strong { overflow-wrap: anywhere; color: #dfe2eb; font-size: .55rem; line-height: 1.35; }
.asset-modal-fact-copy em { overflow-wrap: anywhere; color: var(--muted); font-size: .47rem; font-style: normal; line-height: 1.35; }
.asset-modal-fact.is-empty .asset-modal-fact-icon { background: rgba(151, 161, 196, .07); color: var(--muted); }
.asset-modal-fact.is-empty .asset-modal-fact-copy strong { color: var(--muted); font-weight: 600; }
.asset-editor-media-panel .asset-photo-viewport,
.asset-editor-media-panel .asset-photo-stage { min-height: clamp(188px, 21vw, 260px); }
.asset-editor-media-panel .asset-photo-stage > img { height: clamp(188px, 21vw, 260px); }
.asset-editor-media-panel .asset-reference-panel { border-bottom: 0; background: rgba(7, 11, 20, .36); }
.asset-editor-archived { border-color: rgba(243, 171, 61, .42); }
.asset-archived-notice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(243, 171, 61, .36);
  border-radius: 12px;
  background: rgba(243, 171, 61, .09);
}
.asset-archived-notice-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(243, 171, 61, .15);
  color: var(--amber);
}
.asset-archived-notice-icon svg { width: 19px; height: 19px; }
.asset-archived-notice div { min-width: 0; }
.asset-archived-notice strong { color: #ffd694; font-size: .65rem; }
.asset-archived-notice p { margin: 4px 0; color: #d8c9ad; font-size: .55rem; line-height: 1.5; }
.asset-archived-notice code {
  overflow-wrap: anywhere;
  color: #ffe4b5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.asset-archived-notice small { color: var(--muted); font-size: .5rem; line-height: 1.45; }
.asset-photo-gallery { min-width: 0; display: grid; gap: 8px; border-radius: 13px; outline: 0; }
.asset-photo-gallery:focus-visible { box-shadow: 0 0 0 3px rgba(128,103,255,.24); }
.asset-photo-viewport {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid rgba(151,161,196,.2);
  border-radius: 12px;
  background: #070b14;
  box-shadow: 0 13px 32px rgba(0,0,0,.25);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.asset-photo-gallery.is-dragging .asset-photo-viewport { cursor: grabbing; }
.asset-photo-stage {
  --asset-photo-drag-x: 0px;
  width: 100%;
  min-height: 174px;
  display: grid;
  place-items: center;
  transform: translateX(var(--asset-photo-drag-x));
  transition: transform .18s ease-out;
  will-change: transform;
}
.asset-photo-gallery.is-dragging .asset-photo-stage { transition: none; }
.asset-photo-stage > * { grid-area: 1 / 1; }
.asset-photo-stage > img { position: relative; z-index: 2; width: 100%; height: 174px; object-fit: contain; background: #070b14; }
.asset-photo-empty { display: grid; place-items: center; gap: 5px; padding: 18px; color: var(--muted-2); text-align: center; }
.asset-photo-empty svg { width: 28px; height: 28px; color: var(--violet-bright); opacity: .78; }
.asset-photo-stage.has-error .asset-photo-empty svg { color: var(--amber); }
.asset-photo-empty strong { color: #dfe2eb; font-size: .6rem; }
.asset-photo-empty small { max-width: 180px; font-size: .48rem; line-height: 1.4; }
.asset-photo-add,.asset-photo-delete,.asset-photo-arrow {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(5,8,15,.72);
  color: #f0edff;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}
.asset-photo-add:hover,.asset-photo-delete:hover,.asset-photo-arrow:hover:not(:disabled) { border-color: rgba(128,103,255,.58); background: rgba(35,27,67,.9); }
.asset-photo-add:focus-visible,.asset-photo-delete:focus-visible,.asset-photo-arrow:focus-visible,.asset-photo-dots button:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 2px; }
.asset-photo-add { right: 9px; bottom: 9px; min-width: 84px; min-height: 44px; gap: 6px; padding: 0 12px; border-radius: 12px; font-size: .54rem; font-weight: 700; }
.asset-photo-add svg { width: 15px; height: 15px; }
.asset-photo-delete { top: 9px; right: 9px; width: 44px; height: 44px; border-radius: 11px; color: #ff9caa; }
.asset-photo-delete svg,.asset-photo-arrow svg { width: 16px; height: 16px; }
.asset-photo-arrow { top: 50%; width: 44px; height: 48px; border-radius: 11px; transform: translateY(-50%); }
.asset-photo-arrow:disabled,.asset-photo-add:disabled,.asset-photo-delete:disabled { pointer-events: none; opacity: .42; }
.asset-photo-arrow-prev { left: 8px; }
.asset-photo-arrow-prev svg { transform: rotate(180deg); }
.asset-photo-arrow-next { right: 8px; }
.asset-photo-progress { position: absolute; z-index: 7; inset: 50% auto auto 50%; width: 28px; height: 28px; margin: -14px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--violet-bright); border-radius: 50%; animation: media-spin .8s linear infinite; }
.asset-photo-navigation { min-height: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.asset-photo-dots { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.asset-photo-dots button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 99px; background: transparent; }
.asset-photo-dots button::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: rgba(151,161,196,.34); transition: width .16s ease,background-color .16s ease; }
.asset-photo-dots button[aria-current="true"]::before { width: 18px; background: var(--violet-bright); }
.asset-photo-count { flex: 0 0 auto; color: var(--muted-2); font-size: .48rem; }
.asset-photo-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.asset-photo-action,.asset-photo-primary-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(151,161,196,.18);
  border-radius: 9px;
  background: rgba(12,17,30,.78);
  color: #dfe2eb;
  font-size: .49rem;
  font-weight: 680;
}
.asset-photo-action { transition: border-color .16s ease,background-color .16s ease,color .16s ease; }
.asset-photo-action:hover:not(:disabled) { border-color: rgba(128,103,255,.5); background: rgba(35,27,67,.72); }
.asset-photo-action:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 2px; }
.asset-photo-action svg,.asset-photo-primary-badge svg { width: 14px; height: 14px; }
.asset-photo-primary-badge { border-color: rgba(77,213,145,.25); background: rgba(77,213,145,.08); color: #7ce2ad; }
.asset-photo-primary { border-color: rgba(128,103,255,.28); color: #c8bdff; }
.asset-photo-order-actions { display: inline-flex; gap: 5px; }
.asset-photo-order { width: 34px; padding: 0; }
.asset-photo-order-left svg { transform: rotate(180deg); }
.asset-photo-remove { margin-left: auto; border-color: rgba(255,95,114,.26); color: #ff9caa; }
.asset-photo-remove:hover:not(:disabled) { border-color: rgba(255,95,114,.48); background: rgba(255,95,114,.11); }
.asset-photo-error { margin: -3px 2px 0; color: #efadba; font-size: .48rem; }
.asset-reference-panel { display: grid; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(10,15,27,.62); }
.asset-reference-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-reference-panel h3 { margin: 3px 0 0; font-size: .68rem; }
.asset-reference-panel > p { margin: 0; color: var(--muted); font-size: .51rem; line-height: 1.45; }
.asset-reference-panel .button { min-height: 34px; padding-inline: 11px; }
.asset-reference-panel[aria-busy="true"] .button svg { animation: media-spin .8s linear infinite; }
.asset-reference-error { color: #efadba !important; }
.asset-reference-grid { max-height: 286px; display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 9px; overflow-y: auto; padding: 1px 3px 1px 1px; }
.asset-reference-card { min-width: 0; overflow: hidden; border: 1px solid rgba(151,161,196,.15); border-radius: 11px; background: rgba(6,10,18,.9); }
.asset-reference-image { min-height: 118px; display: grid; place-items: center; overflow: hidden; background: #070b14; }
.asset-reference-image img { width: 100%; height: 118px; object-fit: contain; }
.asset-reference-card > div:last-child { min-width: 0; display: grid; gap: 3px; padding: 8px 9px 9px; }
.asset-reference-card strong,.asset-reference-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-reference-card strong { color: #e3e5ec; font-size: .55rem; }
.asset-reference-card small { color: var(--muted); font-size: .47rem; }
.asset-reference-card span { color: var(--muted-2); font-size: .45rem; line-height: 1.35; }
.asset-reference-card a { color: #aaa0ff; text-decoration: none; }
.asset-reference-card a:hover { text-decoration: underline; }
.toast[data-tone="success"] { border-color: rgba(77,213,145,.3); }
.toast[data-tone="warning"] { border-color: rgba(243,171,61,.3); }
.toast[data-tone="danger"], .toast[data-tone="error"] { border-color: rgba(255,95,114,.34); }

/* Drawers, palettes and popovers */
.drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: rgba(8, 12, 22, .98);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .45);
  backdrop-filter: blur(22px);
  animation: drawer-in .22s ease-out;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(28px); } }
.drawer::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0 100% 0 auto;
  width: 100vw;
  background: rgba(1, 3, 9, .55);
  backdrop-filter: blur(2px);
}
.drawer-head { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 5px 0 0; font-size: 1rem; }
.drawer-tabs { display: flex; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-tabs button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .62rem; }
.drawer-tabs button.active { background: rgba(128, 103, 255, .12); color: #c6bcff; }
.drawer-tabs b { margin-left: 3px; color: var(--violet-bright); }
.notification-list { min-height: 0; flex: 1; overflow-y: auto; }
.notification-list > button {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 7px;
  align-items: start;
  gap: 11px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(151, 161, 196, .08);
  background: transparent;
  text-align: left;
}
.notification-list > button:hover { background: rgba(255, 255, 255, .025); }
.notification-list > button > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.notification-list strong { color: #dfe1e9; font-size: .65rem; }
.notification-list small { color: var(--muted); font-size: .55rem; line-height: 1.4; }
.notification-list time { color: var(--muted-2); font-size: .51rem; }
.notification-list > button > i { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.drawer-footer-action { margin: 12px; width: calc(100% - 24px); }
.search-palette { position: fixed; z-index: 90; inset: 0; display: grid; place-items: start center; padding: min(14vh, 130px) 18px 20px; }
.palette-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(1, 3, 9, .68); backdrop-filter: blur(5px); }
.palette-card { position: relative; width: min(650px, 100%); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 17px; background: rgba(10, 14, 26, .98); box-shadow: 0 32px 100px rgba(0, 0, 0, .58); }
.palette-input { min-height: 62px; display: flex; align-items: center; gap: 11px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input > svg { color: var(--violet-bright); }
.palette-input input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #eef0f5; font-size: .78rem; }
.palette-card kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: #101626; color: var(--muted); font: 500 .52rem/1.2 inherit; }
.palette-body { max-height: 430px; overflow-y: auto; padding: 9px; }
.palette-body > p { padding: 8px; }
.palette-body > button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.palette-body > button:hover, .palette-body > button[aria-selected="true"] { border-color: rgba(128, 103, 255, .2); background: rgba(128, 103, 255, .08); }
.palette-body > button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.palette-body strong { color: #dde0e8; font-size: .66rem; }
.palette-body small, .palette-body em { color: var(--muted); font-size: .54rem; font-style: normal; }
.palette-hint { display: flex; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: .53rem; }
.palette-hint span { display: inline-flex; align-items: center; gap: 5px; }
.popover {
  position: fixed;
  z-index: 75;
  width: 290px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(9, 13, 24, .98);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .46);
  backdrop-filter: blur(18px);
  animation: popover-in .15s ease-out;
}
@keyframes popover-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.quick-create-menu { top: 72px; right: 178px; padding: 8px; }
.quick-create-menu > p { padding: 8px; }
.quick-create-menu > button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.quick-create-menu > button:hover { background: rgba(255, 255, 255, .035); }
.quick-create-menu > button > span:last-child { min-width: 0; display: grid; gap: 3px; }
.quick-create-menu strong { color: #dee0e8; font-size: .63rem; }
.quick-create-menu small { color: var(--muted); font-size: .52rem; }
.user-popover { top: 72px; right: 16px; padding: 7px; }
.user-popover-head { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); }
.user-popover-head > span:last-child { min-width: 0; display: grid; gap: 3px; }
.user-popover-head strong { font-size: .65rem; }
.user-popover-head small { overflow: hidden; color: var(--muted); font-size: .52rem; text-overflow: ellipsis; }
.user-popover > button, .user-popover > a { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #b9bfce; font-size: .62rem; text-align: left; }
.user-popover > button > span { min-width: 0; flex: 1; }
.menu-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 99px; background: rgba(128,103,255,.16); color: var(--violet-bright); font-size: .52rem; }
.user-popover > button:hover, .user-popover > a:hover { background: rgba(255, 255, 255, .035); color: #edf0f6; }
.user-popover hr { height: 1px; margin: 5px 0; border: 0; background: var(--line); }
.user-popover .danger-text { color: #ff8493; }

/* Modal forms and feedback */
.modal-root:empty { display: none; }
.modal-root {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 3, 9, .72);
  backdrop-filter: blur(6px);
}
.modal-dialog, .modal-card, .dialog-card {
  position: relative;
  width: min(660px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(15, 20, 35, .99), rgba(8, 12, 23, .99));
  box-shadow: 0 36px 110px rgba(0, 0, 0, .62);
  animation: modal-in .2s ease-out;
}
.modal-dialog.wide, .modal-card.wide, .dialog-card.wide { width: min(940px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { margin: 4px 0 0; font-size: .96rem; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); }
.modal-close:hover { background: rgba(255, 255, 255, .04); color: white; }
.modal-body { min-height: 0; overflow-y: auto; padding: 18px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 19, .65);
}
.entity-form, .form-stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}
.form-media {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(128, 103, 255, .16);
  border-radius: 12px;
  background: rgba(128, 103, 255, .035);
}
.form-media.processing { opacity: .65; pointer-events: none; }
.form-media-label { color: #c7cbd7; font-size: .58rem; font-weight: 650; }
.form-media-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 14px; }
.form-media-preview {
  width: 150px;
  height: 104px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0e1a;
}
.form-media-preview > img { width: 100%; height: 100%; object-fit: cover; }
.form-media-preview.has-layered-media > * { grid-area: 1 / 1; }
.form-media-preview.has-layered-media > img { position: relative; z-index: 2; }
.media-form-asset { width: 100%; height: 100%; }
.media-form-avatar {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 103, 255, .25);
  border-radius: 50%;
  background: linear-gradient(145deg, #31255b, #172242);
  color: #ddd6ff;
  font-weight: 760;
}
.form-media-actions { min-width: 0; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.form-media-actions > small { width: 100%; color: var(--muted-2); font-size: .51rem; line-height: 1.45; }
.form-media-actions label.button { cursor: pointer; }
.form-field, .entity-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #aeb5c5;
  font-size: .61rem;
  font-weight: 600;
}
.entity-form .form-checkbox {
  min-height: 54px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(128, 103, 255, .16);
  border-radius: 9px;
  background: rgba(128, 103, 255, .035);
}
.entity-form .form-checkbox input[type="checkbox"] { width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--violet); }
.entity-form .form-checkbox span { min-width: 0; display: grid; gap: 4px; }
.entity-form .form-checkbox strong { color: #c7cbd7; font-size: .61rem; }
.form-field-help { color: var(--muted-2); font-size: .49rem; font-weight: 450; line-height: 1.4; }
.asset-location-picker {
  min-width: 0;
  margin: 2px 0;
  padding: 13px;
  border: 1px solid rgba(124, 101, 255, .22);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(124, 101, 255, .07), rgba(79, 139, 255, .025));
}
.asset-location-picker legend {
  display: flex;
  align-items: baseline;
  gap: 9px;
  max-width: 100%;
  padding: 0 7px;
  color: #dfe2ec;
}
.asset-location-picker legend strong { font-size: .66rem; }
.asset-location-picker legend small { color: var(--muted-2); font-size: .49rem; font-weight: 500; }
.asset-location-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.asset-location-grid label { min-width: 0; }
.asset-location-grid select:disabled { cursor: not-allowed; opacity: .58; }
.asset-location-warning {
  display: block;
  margin-top: 9px;
  color: #ffbf69;
  font-size: .5rem;
  line-height: 1.45;
}
.asset-custom-fields {
  min-width: 0;
  display: grid;
  gap: 11px;
  margin-top: 3px;
  padding: 14px;
  border: 1px solid rgba(128,103,255,.22);
  border-radius: 13px;
  background: linear-gradient(145deg,rgba(128,103,255,.065),rgba(76,134,255,.02));
}
.asset-custom-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.asset-custom-fields-head > div { min-width: 0; }
.asset-custom-fields-head h3 { margin: 4px 0 0; color: #e7e4ff; font-size: .7rem; }
.asset-custom-fields-head p { margin: 4px 0 0; color: var(--muted-2); font-size: .5rem; line-height: 1.45; }
.asset-custom-fields-head .button { flex: 0 0 auto; }
.asset-custom-fields-list { min-width: 0; display: grid; gap: 8px; }
.asset-custom-field-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(145px,1fr) 112px minmax(145px,1fr) auto 36px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(151,161,196,.14);
  border-radius: 11px;
  background: rgba(7,11,20,.7);
}
.entity-form .asset-custom-field-row label { gap: 5px; }
.asset-custom-field-row label > span:first-child { color: var(--muted-2); font-size: .48rem; }
.asset-custom-field-value > [data-asset-custom-field-value-host] { min-width: 0; display: block; }
.entity-form .asset-custom-field-boolean {
  min-height: 42px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b101d;
  color: #e2e4ea;
}
.entity-form .asset-custom-field-boolean input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--violet);
}
.asset-custom-field-source {
  align-self: center;
  max-width: 105px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(128,103,255,.09);
  color: #bcb1ff;
  font-size: .44rem;
  line-height: 1.2;
  text-align: center;
}
.asset-custom-field-remove { align-self: center; color: #ff8997; }
.asset-custom-fields-empty {
  padding: 11px;
  border: 1px dashed rgba(151,161,196,.16);
  border-radius: 10px;
  color: var(--muted-2);
  font-size: .52rem;
  text-align: center;
}
.asset-custom-fields-empty[hidden] { display: none; }
.form-field.full, .form-grid .full { grid-column: 1 / -1; }
.form-field input, .form-field select, .form-field textarea,
.entity-form input, .entity-form select, .entity-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #0b101d;
  color: #e2e4ea;
  font-size: .66rem;
  font-weight: 400;
}
.form-field textarea, .entity-form textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.entity-form input:focus, .entity-form select:focus, .entity-form textarea:focus {
  border-color: rgba(128, 103, 255, .55);
  box-shadow: 0 0 0 3px rgba(128, 103, 255, .08);
}
.entity-form .employee-position-field {
  padding: 11px 12px;
  border: 1px solid rgba(128,103,255,.24);
  border-radius: 11px;
  background: linear-gradient(145deg,rgba(128,103,255,.075),rgba(77,139,255,.025));
  color: #d7d1ff;
}
.entity-form .employee-position-field input { border-color: rgba(128,103,255,.28); background: rgba(7,11,20,.82); }
.employee-section-access {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin: 2px 0;
  padding: 14px;
  border: 1px solid rgba(128,103,255,.22);
  border-radius: 13px;
  background: linear-gradient(145deg,rgba(128,103,255,.065),rgba(36,45,75,.025));
}
.employee-access-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.employee-access-heading > div { min-width: 0; }
.employee-access-heading h3 { margin: 4px 0 0; color: #e3e1ef; font-size: .7rem; }
.employee-access-heading p { max-width: 620px; margin: 5px 0 0; color: var(--muted); font-size: .51rem; font-weight: 450; line-height: 1.5; }
.employee-access-count {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(128,103,255,.24);
  border-radius: 8px;
  background: rgba(128,103,255,.08);
  color: #c5bbff;
  font-size: .49rem;
  font-weight: 700;
  white-space: nowrap;
}
.entity-form .employee-access-all,
.entity-form .employee-access-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(151,161,196,.11);
  border-radius: 10px;
  background: rgba(7,11,20,.48);
  cursor: pointer;
}
.entity-form .employee-access-all { border-color: rgba(128,103,255,.2); background: rgba(128,103,255,.045); }
.employee-access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.entity-form .employee-access-all input[type="checkbox"],
.entity-form .employee-access-option input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  accent-color: var(--violet);
}
.employee-access-all span,.employee-access-option span { min-width: 0; display: grid; gap: 3px; }
.employee-access-all strong,.employee-access-option strong { color: #d4d7e0; font-size: .57rem; }
.employee-access-all small,.employee-access-option small { color: var(--muted-2); font-size: .47rem; font-weight: 450; line-height: 1.4; }
.employee-access-option:has(input:checked),.employee-access-all:has(input:checked) { border-color: rgba(128,103,255,.3); background: rgba(128,103,255,.07); }
.employee-section-access[aria-readonly="true"] .employee-access-all,
.employee-section-access[aria-readonly="true"] .employee-access-option { cursor: default; opacity: .78; }
.form-hint { color: var(--muted-2); font-size: .52rem; font-weight: 400; line-height: 1.45; }
.form-error, .field-error { margin: 0; color: #ff8997; font-size: .58rem; }
.confirm-copy { margin: 0; color: #b7bdcb; font-size: .7rem; line-height: 1.6; }
.confirm-copy strong { color: #f0f1f5; }
.toast {
  --toast-swipe-x: 0px;
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  width: min(360px, calc(100vw - 32px));
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 18, 32, .98);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .45);
  color: #dce0e8;
  font-size: .65rem;
  line-height: 1.45;
  touch-action: pan-y;
  user-select: none;
  transform: translate3d(var(--toast-swipe-x), 16px, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  will-change: transform, opacity;
}
.toast.is-visible, .toast.show, .toast.visible { transform: translate3d(var(--toast-swipe-x), 0, 0); opacity: 1; pointer-events: auto; }
.toast.is-swiping { transition: none; }
.toast.is-dismissing-right { transform: translate3d(calc(100% + 40px), 0, 0); opacity: 0; pointer-events: none; }
.toast-message { min-width: 0; flex: 1 1 auto; }
.toast-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #cfd3dd;
  background: rgba(255, 255, 255, .055);
  font: 400 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.toast-close:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 2px; }
.toast.success { border-color: rgba(77, 213, 145, .3); }
.toast.error { border-color: rgba(255, 95, 114, .35); }
.toast.warning { border-color: rgba(243, 171, 61, .35); }
.loading-state { min-height: 320px; display: grid; place-items: center; color: var(--muted); font-size: .7rem; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(128, 103, 255, .16); border-top-color: var(--violet); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { overflow: hidden; border-radius: 7px; background: rgba(151, 161, 196, .08); }
.skeleton::after { content: ""; display: block; width: 45%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-120%); } to { transform: translateX(260%); } }
.noscript { min-height: 100vh; display: grid; place-items: center; padding: 30px; color: #e2e4ea; background: var(--bg); text-align: center; }

/* Digital floor-plan integrator */
.plan-page { display: grid; gap: 16px; min-width: 0; }
.plan-intro {
  min-height: 146px; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(420px,.9fr);
  align-items: center; gap: 34px; padding: 26px 30px; overflow: hidden;
  border: 1px solid rgba(128,103,255,.2); border-radius: 20px;
  background: radial-gradient(circle at 84% 0%,rgba(108,75,255,.2),transparent 40%),linear-gradient(135deg,rgba(14,20,37,.98),rgba(8,12,23,.98));
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}
.plan-intro h1 { margin: 7px 0 8px; font-size: clamp(1.45rem,2vw,2.15rem); letter-spacing: -.04em; }
.plan-intro p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.65; }
.plan-intro-steps { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 8px; }
.plan-intro-steps span { display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: .65rem; white-space: nowrap; }
.plan-intro-steps b { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.35); border-radius: 50%; background: rgba(128,103,255,.12); color: var(--violet-bright); font-size: .72rem; }
.plan-intro-steps i { height: 1px; background: linear-gradient(90deg,rgba(128,103,255,.45),rgba(128,103,255,.08)); }
.plan-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(11,16,29,.88); }
.plan-toolbar > label { display: grid; gap: 4px; color: var(--muted); font-size: .55rem; text-transform: uppercase; letter-spacing: .08em; }
.plan-toolbar select { min-width: 165px; height: 38px; padding: 0 34px 0 11px; }
.plan-toolbar-meta { min-width: 210px; display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: center; column-gap: 9px; padding-left: 8px; }
.plan-toolbar-meta .status-dot { grid-row: 1 / span 2; background: var(--green); box-shadow: 0 0 14px rgba(70,216,142,.5); }
.plan-toolbar-meta strong { font-size: .69rem; }
.plan-toolbar-meta small { overflow: hidden; color: var(--muted); font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
.plan-studio-shell { min-width: 0; min-height: 610px; border-radius: 19px; transition: opacity .2s ease; }
.plan-studio-shell.is-saving { opacity: .65; pointer-events: none; }
.plan-studio-shell.is-readonly .ps-plan-state::after { content: " · просмотр"; color: var(--muted); }
.plan-collaboration { display: grid; grid-template-columns: minmax(340px,.85fr) minmax(480px,1.15fr); gap: 16px; align-items: stretch; }
.plan-context-card,.plan-chat-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg,rgba(13,19,34,.98),rgba(8,13,24,.98)); box-shadow: 0 18px 45px rgba(0,0,0,.16); }
.plan-context-card { display: grid; align-content: start; gap: 16px; }
.plan-context-heading { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.plan-context-heading h2,.plan-context-card > div h2 { margin: 4px 0 0; font-size: 1.08rem; }
.plan-context-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.25); border-radius: 14px; background: rgba(128,103,255,.1); color: var(--violet-bright); }
.plan-context-icon svg { width: 23px; height: 23px; }
.plan-context-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; border-block: 1px solid var(--line); }
.plan-context-stats div { min-width: 0; padding: 12px 10px; }
.plan-context-stats div + div { border-left: 1px solid var(--line); }
.plan-context-stats dt { color: var(--muted); font-size: .55rem; }
.plan-context-stats dd { margin: 5px 0 0; overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.plan-context-assets { display: grid; gap: 7px; }
.plan-context-assets > button { width: 100%; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px; border: 1px solid transparent; border-radius: 12px; background: rgba(255,255,255,.018); color: var(--text); text-align: left; }
.plan-context-assets > button:hover { border-color: rgba(128,103,255,.2); background: rgba(128,103,255,.06); }
.plan-context-assets strong,.plan-context-assets small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-context-assets strong { font-size: .65rem; }
.plan-context-assets small { margin-top: 3px; color: var(--muted); font-size: .53rem; }
.plan-asset-media { width: 46px; height: 42px; border-radius: 9px; }
.plan-asset-media .asset-media-fallback small { display: none; }
.plan-chat-card { display: grid; grid-template-rows: auto minmax(140px,1fr) auto; gap: 14px; }
.plan-chat-header { display: flex; align-items: center; justify-content: space-between; }
.plan-chat-header-actions { display: flex; align-items: center; gap: 7px; }
.plan-chat-header h2 { margin: 4px 0 0; font-size: 1.08rem; }
.plan-chat-count { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: rgba(128,103,255,.13); color: var(--violet-bright); font-size: .65rem; }
.plan-message-list { max-height: 420px; display: grid; align-content: start; gap: 12px; padding-right: 5px; overflow: auto; scrollbar-color: rgba(128,103,255,.35) transparent; }
.plan-message { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; }
.plan-message.is-resolved { opacity: .65; }
.plan-message-avatar { position: relative; width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(128,103,255,.28); border-radius: 50%; background: linear-gradient(145deg,#5b48cc,#282f57); color: #fff; font-size: .58rem; }
.plan-message-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plan-message-body { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 4px 14px 14px; background: rgba(255,255,255,.022); }
.plan-message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-message-head strong { font-size: .63rem; }
.plan-message-head time { color: var(--muted); font-size: .5rem; }
.plan-message-body p { margin: 7px 0 0; color: #dfe3ef; font-size: .64rem; line-height: 1.55; white-space: pre-wrap; }
.plan-message-photo { width: min(100%,360px); max-height: 210px; display: block; margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #070b14; }
.plan-message-photo img { width: 100%; height: 100%; max-height: 210px; display: block; object-fit: cover; }
.plan-message-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.plan-message-tags span,.plan-message-tags button { min-height: 25px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid rgba(128,103,255,.15); border-radius: 8px; background: rgba(128,103,255,.07); color: var(--violet-bright); font-size: .5rem; }
.plan-message-tags svg { width: 12px; height: 12px; }
.plan-message-tags .resolved-tag { color: var(--green); }
.plan-chat-form { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.plan-chat-form textarea { min-height: 72px; resize: vertical; }
.plan-chat-media { display: contents; }
.plan-chat-photo-preview:empty { display: none; }
.plan-chat-photo-preview:not(:empty) { width: 96px; height: 62px; overflow: hidden; border: 1px solid rgba(128,103,255,.25); border-radius: 10px; }
.plan-chat-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.plan-location-draft { min-height: 27px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .55rem; }
.plan-location-draft svg { width: 13px; height: 13px; }
.plan-location-draft.is-set { color: var(--violet-bright); }
.plan-location-draft button { border: 0; background: transparent; color: var(--red); font-size: inherit; }
.plan-chat-actions { display: flex; align-items: center; gap: 8px; }
.plan-chat-actions .button:last-child { margin-left: auto; }
.plan-chat-empty { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.plan-chat-empty.compact { min-height: 90px; }
.plan-chat-empty svg { width: 28px; height: 28px; color: var(--violet-bright); }
.plan-chat-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.2); border-radius: 14px; background: linear-gradient(145deg, rgba(76,134,255,.09), rgba(128,103,255,.14)); }
.plan-chat-empty h2,.plan-chat-empty p { margin: 0; }
.plan-chat-empty h2 { color: var(--text); font-size: .9rem; }
.plan-chat-empty p { max-width: 430px; font-size: .62rem; line-height: 1.55; }
.plan-chat-readonly { padding: 12px; border-radius: 10px; background: rgba(255,255,255,.025); color: var(--muted); font-size: .6rem; text-align: center; }
.plan-photo-modal { width: min(960px,calc(100vw - 32px)); }
.plan-photo-modal > img { width: 100%; max-height: 72vh; display: block; border-radius: 12px; object-fit: contain; background: #050811; }

/* Facilities, personnel property and file cards */
.facility-directory { display: grid; gap: 14px; }
.facility-grid { display: grid; grid-template-columns: repeat(3,minmax(240px,1fr)); gap: 13px; }
.facility-card {
  min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(145deg,rgba(16,22,38,.98),rgba(8,13,24,.98));
  box-shadow: 0 15px 34px rgba(0,0,0,.15); transition: border-color .18s ease,transform .18s ease;
}
.facility-card:hover,.facility-card.is-selected { border-color: rgba(128,103,255,.36); }
.facility-card.is-selected { box-shadow: 0 0 0 1px rgba(128,103,255,.12),0 18px 40px rgba(0,0,0,.2); }
.facility-card-main { width: 100%; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 14px; border: 0; background: transparent; color: var(--text); text-align: left; }
.facility-card-icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.22); border-radius: 13px; background: rgba(128,103,255,.09); color: var(--violet-bright); }
.facility-card-icon svg { width: 23px; height: 23px; }
.facility-card-main > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.facility-card-main small { color: var(--violet-bright); font-size: .48rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.facility-card-main strong,.facility-card-main em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facility-card-main strong { font-size: .7rem; }
.facility-card-main em { color: var(--muted); font-size: .52rem; font-style: normal; }
.facility-card > dl { display: grid; grid-template-columns: repeat(3,1fr); margin: 0 14px; padding: 11px 0; border-block: 1px solid var(--line); }
.facility-card > dl div { display: grid; justify-items: center; gap: 3px; }
.facility-card > dl div + div { border-left: 1px solid var(--line); }
.facility-card > dl dt { color: var(--muted-2); font-size: .48rem; }
.facility-card > dl dd { margin: 0; color: #d8dbe4; font-size: .65rem; font-weight: 720; }
.facility-floor-directory { min-width: 0; display: grid; gap: 7px; padding: 10px 14px 2px; }
.facility-floor-directory > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.facility-floor-directory > header strong { color: #cdd1dc; font-size: .55rem; letter-spacing: .05em; text-transform: uppercase; }
.facility-floor-directory > header small { color: var(--muted-2); font-size: .47rem; }
.facility-floor-directory > div { max-height: 132px; display: grid; gap: 5px; overflow-y: auto; scrollbar-gutter: stable; }
.facility-floor-directory > div > p { margin: 4px 0 8px; color: var(--muted-2); font-size: .52rem; }
.facility-floor-row {
  min-width: 0; width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) 16px; align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid rgba(151,161,196,.09); border-radius: 9px; background: rgba(255,255,255,.018);
  color: var(--text); text-align: left; transition: border-color .16s ease,background .16s ease;
}
.facility-floor-row:hover,.facility-floor-row:focus-visible { border-color: rgba(128,103,255,.35); background: rgba(128,103,255,.07); outline: 0; }
.facility-floor-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(128,103,255,.1); color: var(--violet-bright); font-size: .59rem; font-weight: 780; }
.facility-floor-row > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.facility-floor-row strong,.facility-floor-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facility-floor-row strong { color: #dfe1e8; font-size: .56rem; }
.facility-floor-row small { color: var(--muted-2); font-size: .47rem; }
.facility-floor-row > svg { width: 15px; height: 15px; color: var(--muted); }
.facility-card > footer { display: flex; gap: 7px; padding: 12px 14px; }
.facility-card > footer .button { flex: 1; }
.facility-card > footer .icon-button { width: 36px; height: 36px; }

.asset-card-visual { position: relative; }
.asset-card-visual .asset-card-open { height: 178px; }
.asset-quick-photo {
  position: absolute; z-index: 6; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(5,8,15,.68); color: #e7e2ff;
  box-shadow: 0 8px 20px rgba(0,0,0,.2); backdrop-filter: blur(9px);
}
.asset-quick-photo:hover { border-color: rgba(128,103,255,.52); background: rgba(35,27,67,.88); }
.asset-quick-photo svg { width: 16px; height: 16px; }
.asset-media.category-uniform { background: radial-gradient(circle at 65% 20%,rgba(76,134,255,.24),transparent 36%),linear-gradient(145deg,#18253b,#0a101d); }

.employee-assets { display: grid; gap: 5px; padding: 7px; border: 1px solid rgba(151,161,196,.08); border-radius: 11px; background: rgba(255,255,255,.018); }
.employee-assets > button,.employee-modal-assets > div > button { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 5px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); text-align: left; }
.employee-assets > button:hover,.employee-modal-assets > div > button:hover { border-color: rgba(128,103,255,.2); background: rgba(128,103,255,.05); }
.employee-assets > button > span:nth-child(2),.employee-modal-assets > div > button > span:nth-child(2) { min-width: 0; }
.employee-assets strong,.employee-assets small,.employee-modal-assets strong,.employee-modal-assets small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-assets strong,.employee-modal-assets strong { font-size: .55rem; }
.employee-assets small,.employee-modal-assets small { margin-top: 2px; color: var(--muted-2); font-size: .47rem; }
.employee-assets > p { margin: 4px; color: var(--muted-2); font-size: .52rem; }
.employee-asset-media { width: 38px; height: 34px; border-radius: 8px; }
.employee-asset-media .asset-media-fallback small { display: none; }
.employee-card-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; }
.modal-card:has(> .employee-assets-manager) { height: min(88dvh,900px); }
.modal-card:has(> .employee-assets-manager) > .modal-head { flex: 0 0 auto; }
.employee-assets-manager {
  min-height: 0; max-height: min(34dvh,340px); display: grid; flex: 0 1 auto; gap: 10px; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable;
}
.modal-card:has(> .employee-assets-manager) > .entity-form {
  min-height: 110px; display: grid; flex: 1 1 260px; grid-template-rows: minmax(0,1fr) auto auto; overflow: hidden;
}
.modal-card:has(> .employee-assets-manager) > .entity-form > .form-grid {
  min-height: 0; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.modal-card:has(> .employee-assets-manager) > .entity-form > .modal-actions {
  position: relative; z-index: 3; flex: 0 0 auto; margin: 0 -18px -18px;
  box-shadow: 0 -10px 24px rgba(3,6,13,.22);
}
.employee-modal-assets { display: grid; gap: 10px; margin: 0 16px; padding: 13px; border: 1px solid rgba(128,103,255,.16); border-radius: 12px; background: rgba(128,103,255,.035); }
.employee-modal-assets > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.employee-modal-assets h3 { margin: 3px 0 0; font-size: .7rem; }
.employee-modal-assets > div { max-height: 190px; display: grid; gap: 4px; overflow-y: auto; }
.employee-asset-search {
  min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  border: 1px solid rgba(151,161,196,.13); border-radius: 9px; background: rgba(5,9,18,.54); color: var(--muted-2);
}
.employee-asset-search:focus-within { border-color: rgba(128,103,255,.48); box-shadow: 0 0 0 3px rgba(128,103,255,.08); color: #c0b5ff; }
.employee-asset-search > svg { width: 14px; height: 14px; flex: 0 0 auto; }
.employee-asset-search > input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: .54rem; }
.employee-asset-search > input::placeholder { color: var(--muted-2); }
.employee-asset-scroll { min-height: 0; max-height: 230px !important; padding-right: 3px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.employee-asset-assignment {
  min-height: 0; display: grid; gap: 10px; margin: 0 16px; padding: 13px;
  border: 1px solid rgba(76,134,255,.22); border-radius: 12px; background: rgba(76,134,255,.045);
}
.employee-asset-assignment > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.employee-asset-assignment > header h3 { margin: 3px 0 0; font-size: .7rem; }
.employee-asset-assignment > header p { margin: 5px 0 0; color: var(--muted-2); font-size: .5rem; }
.employee-asset-picker-list {
  min-height: 0; max-height: 300px; display: grid; align-content: start; gap: 5px; overflow-y: auto;
  padding-right: 3px; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.employee-asset-picker-row {
  min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 5px;
  border: 1px solid rgba(151,161,196,.09); border-radius: 10px; background: rgba(255,255,255,.018);
}
.employee-assigned-asset-row {
  min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 5px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
}
.employee-asset-picker-row:hover,.employee-assigned-asset-row:hover { border-color: rgba(128,103,255,.25); background: rgba(128,103,255,.045); }
.employee-asset-picker-open {
  min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); text-align: left;
}
.employee-asset-picker-open > span { min-width: 0; }
.employee-asset-picker-open strong,.employee-asset-picker-open small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-asset-picker-open strong { font-size: .55rem; }
.employee-asset-picker-open small { margin-top: 2px; color: var(--muted-2); font-size: .47rem; }
.employee-asset-assign-button { min-width: 90px; height: 32px; padding: 0 11px; }
.employee-asset-unassign-button { min-width: 64px; height: 30px; padding: 0 9px; color: var(--muted); }
.employee-asset-unassign-button:hover { border-color: rgba(255,95,114,.35); color: #ff9da8; }
.employee-assets-no-results { margin: 0; padding: 8px; text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

.media-source-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.form-plan-file { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 8px 14px; padding: 13px; border: 1px solid rgba(76,134,255,.18); border-radius: 12px; background: rgba(76,134,255,.035); }
.form-plan-file.processing { opacity: .65; pointer-events: none; }
.form-plan-file > .form-media-label { grid-column: 1 / -1; }
.plan-file-preview { min-height: 120px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #080d18; }
.plan-file-preview > img { width: 100%; height: 150px; object-fit: cover; }
.plan-file-preview.has-layered-media > * { grid-area: 1 / 1; }
.plan-file-preview.has-layered-media > img { position: relative; z-index: 2; }
.plan-file-document,.plan-file-empty { display: grid; place-items: center; gap: 5px; padding: 14px; color: var(--muted); text-align: center; }
.plan-file-document svg,.plan-file-empty svg { width: 30px; height: 30px; color: var(--violet-bright); }
.plan-file-document strong,.plan-file-empty strong { max-width: 150px; overflow: hidden; color: #dfe2eb; font-size: .6rem; text-overflow: ellipsis; white-space: nowrap; }
.plan-file-document small,.plan-file-empty small { color: var(--muted-2); font-size: .5rem; }
.plan-file-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.print-frame { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; border: 0; opacity: 0; }
.protected-plan-loading { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.protected-plan-loading span { width: 30px; height: 30px; border: 3px solid rgba(128,103,255,.2); border-top-color: var(--violet-bright); border-radius: 50%; animation: media-spin .8s linear infinite; }
.protected-plan-loading strong { font-size: .62rem; font-weight: 650; }
@keyframes media-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .protected-plan-loading span { animation: none; } }
.import-report-body { min-height: 0; overflow-y: auto; padding: 18px; }
.import-report-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.import-report-metrics div { display: grid; justify-items: center; gap: 3px; padding: 13px; border-radius: 11px; background: rgba(128,103,255,.07); }
.import-report-metrics strong { font-size: 1.1rem; }
.import-report-metrics span { color: var(--muted); font-size: .5rem; }
.import-report-body ul { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.import-report-body li { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; padding: 9px; border: 1px solid rgba(255,95,114,.14); border-radius: 8px; color: var(--muted); font-size: .54rem; }
.import-report-body li strong { color: #ff94a1; }

/* Team chat */
.chat-page {
  min-height: calc(100dvh - var(--topbar) - 48px); display: grid; grid-template-columns: 286px minmax(360px,1fr) 280px;
  overflow: hidden; border: 1px solid var(--line-strong); border-radius: 19px;
  background: linear-gradient(145deg,rgba(13,18,32,.99),rgba(7,10,19,.99)); box-shadow: 0 24px 70px rgba(0,0,0,.25);
}
.chat-sidebar,.chat-management { min-width: 0; display: flex; flex-direction: column; background: rgba(7,11,21,.62); }
.chat-sidebar { border-right: 1px solid var(--line); }
.chat-sidebar > header,.chat-management section > header,.chat-conversation-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.chat-sidebar h1,.chat-management h3,.chat-conversation-head h2 { margin: 4px 0 0; font-size: .78rem; }
.chat-sidebar-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-sidebar-section + .chat-sidebar-section { border-top: 1px solid var(--line); }
.chat-sidebar-section-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 3px 13px; color: var(--muted); }
.chat-sidebar-section-head > span { font-size: .48rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.chat-sidebar-section-head > small { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: rgba(128,103,255,.1); color: #b8abff; font-size: .44rem; }
.chat-sidebar-section-head .icon-button { width: 29px; height: 29px; }
.chat-channel-list,.chat-employee-list { min-height: 0; display: grid; align-content: start; gap: 5px; padding: 5px 9px 10px; }
.chat-channel { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; }
.chat-channel:hover,.chat-channel.active { border-color: rgba(128,103,255,.2); background: rgba(128,103,255,.075); color: var(--text); }
.chat-channel > span:first-child,.chat-channel-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(128,103,255,.12); color: var(--violet-bright); }
.chat-channel svg,.chat-channel-avatar svg { width: 17px; height: 17px; }
.chat-channel > span:nth-child(2) { min-width: 0; }
.chat-channel strong,.chat-channel small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-channel strong { color: #dfe2ea; font-size: .61rem; }
.chat-channel small { margin-top: 3px; color: var(--muted-2); font-size: .48rem; }
.chat-list-preview.has-unread { color: #c8c0ff; font-weight: 650; }
.chat-channel-tail { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.chat-channel-tail b { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .46rem; font-weight: 750; }
.chat-channel-tail svg { width: 13px; height: 13px; }
.chat-person { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; }
.chat-person:hover,.chat-person.active { border-color: rgba(77,213,145,.22); background: rgba(77,213,145,.06); color: var(--text); }
.chat-person.is-unavailable { cursor: not-allowed; opacity: .52; }
.chat-person.is-unavailable:hover { border-color: transparent; background: transparent; }
.chat-person-avatar-wrap { position: relative; width: 36px; height: 36px; display: block; }
.chat-person-avatar { position: relative; width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(128,103,255,.22); border-radius: 50%; background: #252c4b; color: white; font-size: .48rem; }
.chat-person-avatar img,.chat-direct-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-person-avatar-wrap .presence { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border: 2px solid #0a0f1c; border-radius: 50%; }
.chat-person > span:nth-child(2) { min-width: 0; }
.chat-person strong,.chat-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-person strong { color: #dfe2ea; font-size: .58rem; }
.chat-person small { margin-top: 3px; color: var(--muted-2); font-size: .47rem; }
.chat-person-loading { width: 15px; height: 15px; border: 2px solid rgba(128,103,255,.2); border-top-color: var(--violet-bright); border-radius: 50%; animation: media-spin .8s linear infinite; }
.chat-admin-actions { display: grid; gap: 6px; padding: 9px; border-top: 1px solid var(--line); }
.chat-conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: radial-gradient(circle at 90% 0%,rgba(128,103,255,.08),transparent 34%); }
.chat-conversation-head { justify-content: flex-start; }
.chat-conversation-head > div,.chat-channel-heading { min-width: 0; flex: 1; }
.chat-conversation-head h2,.chat-conversation-head p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation-head p { margin: 3px 0 0; color: var(--muted); font-size: .51rem; }
.chat-direct-heading { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; padding: 3px; border: 0; border-radius: 11px; background: transparent; color: var(--text); text-align: left; }
button.chat-direct-heading:hover { background: rgba(128,103,255,.07); }
.chat-direct-heading-copy { min-width: 0; flex: 1; display: block; }
.chat-direct-heading-copy h2,.chat-direct-heading-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-direct-avatar { position: relative; flex: 0 0 36px; overflow: hidden; border-radius: 50%; }
.chat-back { display: none; transform: rotate(180deg); }
.chat-message-list { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 18px; overscroll-behavior: contain; }
.chat-load-older { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); font-size: .49rem; }
.chat-load-older:hover { border-color: rgba(128,103,255,.28); color: #d8d1ff; }
.chat-load-older svg { width: 13px; height: 13px; }
.chat-message { width: min(76%,680px); display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: end; gap: 8px; }
.chat-message.is-mine { align-self: flex-end; grid-template-columns: minmax(0,1fr) 34px; }
.chat-message.is-mine .chat-message-avatar { grid-column: 2; }
.chat-message.is-mine > div { grid-column: 1; grid-row: 1; border-radius: 13px 4px 13px 13px; background: rgba(128,103,255,.13); }
.chat-message-avatar { position: relative; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(128,103,255,.25); border-radius: 50%; background: #252c4b; color: #fff; font-size: .48rem; }
.chat-message-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-message > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 13px 13px; background: rgba(255,255,255,.025); }
.chat-message header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-message header strong { color: #cfd4e1; font-size: .52rem; }
.chat-message header time { color: var(--muted-2); font-size: .45rem; }
.chat-message p { margin: 6px 0 0; color: #e4e7ef; font-size: .64rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-attachment-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 9px; }
.chat-photo-card { position: relative; min-height: 118px; overflow: hidden; display: grid; place-items: center; padding: 0; border: 1px solid rgba(128,103,255,.18); border-radius: 10px; background: #090e1a; color: #fff; }
.chat-photo-card img { width: 100%; height: 150px; display: block; object-fit: cover; }
.chat-photo-card > span { position: absolute; right: 7px; bottom: 7px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(4,7,13,.72); backdrop-filter: blur(8px); }
.chat-photo-card > span svg { width: 13px; height: 13px; }
.chat-file-card { width: 100%; min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid rgba(76,134,255,.18); border-radius: 10px; background: rgba(76,134,255,.055); color: var(--text); text-align: left; }
.chat-file-card > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(76,134,255,.12); color: #78a0ff; }
.chat-file-card > span:nth-child(2) { min-width: 0; }
.chat-file-card strong,.chat-file-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-card strong { font-size: .53rem; }
.chat-file-card small { margin-top: 2px; color: var(--muted-2); font-size: .45rem; }
.chat-file-card svg { width: 15px; height: 15px; }
.chat-file-card.is-unavailable { opacity: .6; cursor: default; }
.chat-reference-list { display: grid; gap: 6px; margin-top: 9px; }
.chat-reference-list.is-draft { grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); margin-top: 0; }
.chat-reference-card { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; overflow: hidden; border: 1px solid rgba(128,103,255,.18); border-radius: 10px; background: rgba(128,103,255,.055); }
.chat-reference-card.is-unavailable { opacity: .6; }
.chat-reference-main { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px; border: 0; background: transparent; color: var(--text); text-align: left; }
.chat-reference-main > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(128,103,255,.12); color: var(--violet-bright); }
.chat-reference-main > span:last-child { min-width: 0; }
.chat-reference-main small,.chat-reference-main strong,.chat-reference-main em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reference-main small { color: #9e8dff; font-size: .42rem; font-weight: 700; text-transform: uppercase; }
.chat-reference-main strong { margin-top: 2px; font-size: .54rem; }
.chat-reference-main em { margin-top: 2px; color: var(--muted-2); font-size: .44rem; font-style: normal; }
.chat-reference-main svg { width: 16px; height: 16px; }
.chat-reference-remove { width: 32px; border: 0; border-left: 1px solid rgba(128,103,255,.12); background: transparent; color: var(--muted-2); }
.chat-reference-remove:hover { background: rgba(255,95,114,.08); color: #ff8492; }
.chat-reference-remove svg { width: 13px; height: 13px; }
.chat-compose { display: grid; gap: 8px; padding: 11px 13px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(7,10,19,.84); }
.chat-compose-draft { max-height: 210px; overflow-y: auto; display: grid; gap: 7px; }
.chat-compose:not(.has-chat-draft) .chat-compose-draft { display: none; }
.chat-compose-main { min-width: 0; display: grid; grid-template-columns: auto minmax(120px,1fr) auto; align-items: end; gap: 8px; }
.chat-compose-tools { display: flex; align-items: center; gap: 4px; }
.chat-compose-tools .icon-button { width: 34px; height: 34px; flex: 0 0 auto; cursor: pointer; }
.chat-compose textarea { min-height: 42px; max-height: 130px; resize: vertical; }
.chat-compose .button { align-self: end; }
.chat-compose .chat-send-button {
  position: relative;
  width: 44px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(169, 151, 255, .58);
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, .28), transparent 34%),
    linear-gradient(145deg, #927cff 0%, #6f54f2 54%, #4b35c7 100%);
  color: #fff;
  box-shadow: 0 9px 24px rgba(91, 65, 222, .34), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.chat-compose .chat-send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.08) brightness(1.06);
  box-shadow: 0 12px 29px rgba(91, 65, 222, .42), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.chat-compose .chat-send-button:active:not(:disabled) {
  transform: translateY(0) scale(.95);
}
.chat-compose .chat-send-button:disabled {
  opacity: .48;
  filter: saturate(.65);
  box-shadow: none;
}
.chat-compose .chat-send-button .ui-icon {
  width: 19px;
  height: 19px;
  transform: translate(1px, -1px);
  stroke-width: 1.8;
}
.chat-draft-attachment-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 6px; }
.chat-draft-attachment { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) 28px; align-items: center; gap: 7px; padding: 6px; border: 1px solid rgba(76,134,255,.18); border-radius: 9px; background: rgba(76,134,255,.045); }
.chat-draft-attachment > img,.chat-draft-attachment > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: rgba(76,134,255,.1); object-fit: cover; color: #78a0ff; }
.chat-draft-attachment > div { min-width: 0; }
.chat-draft-attachment strong,.chat-draft-attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-draft-attachment strong { font-size: .49rem; }
.chat-draft-attachment small { margin-top: 2px; color: var(--muted-2); font-size: .43rem; }
.chat-draft-attachment > button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); }
.chat-draft-attachment > button:hover { background: rgba(255,95,114,.08); color: #ff8492; }
.chat-draft-attachment svg { width: 13px; height: 13px; }
.chat-reference-picker { width: min(720px,100%); }
.chat-reference-picker-controls { display: grid; grid-template-columns: minmax(150px,.65fr) minmax(220px,1.35fr); gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.chat-reference-picker-controls label { display: grid; gap: 6px; color: var(--muted); font-size: .5rem; }
.chat-reference-picker-results { min-height: 180px; max-height: min(520px,62vh); display: grid; align-content: start; gap: 5px; overflow-y: auto; padding: 10px; }
.chat-reference-picker-row { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) 20px; align-items: center; gap: 9px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.chat-reference-picker-row:hover { border-color: rgba(128,103,255,.2); background: rgba(128,103,255,.055); }
.chat-reference-picker-row > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: rgba(128,103,255,.11); color: var(--violet-bright); }
.chat-reference-picker-row > span:nth-child(2) { min-width: 0; }
.chat-reference-picker-row strong,.chat-reference-picker-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reference-picker-row strong { font-size: .58rem; }
.chat-reference-picker-row small { margin-top: 3px; color: var(--muted-2); font-size: .47rem; }
.chat-reference-picker-row svg { width: 15px; height: 15px; }
.chat-photo-modal { width: min(980px,100%); }
.chat-photo-modal-body { min-height: 240px; display: grid; place-items: center; overflow: auto; padding: 12px; background: #050810; }
.chat-photo-modal-body img { max-width: 100%; max-height: min(74vh,860px); border-radius: 9px; object-fit: contain; }
.chat-management { border-left: 1px solid var(--line); overflow-y: auto; }
.chat-management section + section { border-top: 1px solid var(--line); }
.department-list { display: grid; gap: 4px; padding: 8px; }
.department-list > button { width: 100%; display: grid; grid-template-columns: 9px minmax(0,1fr) 15px; align-items: center; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); text-align: left; }
.department-list > button:hover { border-color: var(--line); background: rgba(255,255,255,.025); }
.department-list i { width: 8px; height: 28px; border-radius: 5px; background: var(--department-color,#8067ff); }
.department-list i.department-color-0 { --department-color: #8067ff; }
.department-list i.department-color-1 { --department-color: #4c86ff; }
.department-list i.department-color-2 { --department-color: #4dd591; }
.department-list i.department-color-3 { --department-color: #f2b766; }
.department-list i.department-color-4 { --department-color: #ff5f72; }
.department-list i.department-color-5 { --department-color: #45c6d8; }
.department-list strong,.department-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.department-list strong { font-size: .55rem; }
.department-list small { margin-top: 3px; color: var(--muted-2); font-size: .46rem; }
.department-list svg { width: 13px; height: 13px; color: var(--muted-2); }
.employee-department-list > button { grid-template-columns: 30px minmax(0,1fr) 15px; }
.employee-department-list > button > .avatar { width: 30px; height: 30px; }
.chat-member-manager { display: grid; gap: 3px; padding: 10px; }
.chat-member-manager > .section-kicker { margin: 3px 4px 7px; }
.chat-member-manager label { display: grid; grid-template-columns: 16px 30px minmax(0,1fr); align-items: center; gap: 7px; padding: 6px; border-radius: 8px; cursor: pointer; }
.chat-member-manager label:hover { background: rgba(255,255,255,.025); }
.chat-member-manager label.is-unavailable { cursor: not-allowed; opacity: .55; }
.chat-member-manager label.is-unavailable:hover { background: transparent; }
.chat-member-manager strong,.chat-member-manager small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-member-manager strong { font-size: .52rem; }
.chat-member-manager small { color: var(--muted-2); font-size: .44rem; }
.chat-access-note { display: flex; align-items: center; gap: 8px; margin: 10px; padding: 11px; border-radius: 9px; background: rgba(77,213,145,.06); color: #99dcb9; font-size: .52rem; line-height: 1.4; }
.chat-access-note svg { width: 16px; height: 16px; flex: 0 0 auto; }
.chat-settings-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow-y: auto; background: var(--line); }
.chat-settings-grid > section { min-width: 0; background: #0b101d; }
.chat-settings-grid > section > header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.chat-settings-grid h3 { margin: 0; font-size: .67rem; }
.chat-empty { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 20px; color: var(--muted); text-align: center; }
.chat-empty > span { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(128,103,255,.2); border-radius: 15px; background: linear-gradient(145deg, rgba(76,134,255,.09), rgba(128,103,255,.14)); color: var(--violet-bright); box-shadow: inset 0 1px rgba(255,255,255,.045); }
.chat-empty > span svg { width: 27px; height: 27px; }
.chat-sidebar .chat-empty { min-height: 88px; padding: 12px 8px; }
.chat-sidebar .chat-people-empty { min-height: 58px; }
.chat-empty h2,.chat-empty h3,.chat-empty p { margin: 0; }
.chat-empty h3 { color: var(--text); font-size: .72rem; }
.chat-empty p { font-size: .54rem; line-height: 1.5; }
.modal-card,.drawer,.palette-card,.sidebar,.popover { touch-action: pan-y; }

/* Large and compact desktop */
@media (max-width: 1440px) {
  :root { --sidebar: 232px; }
  .auth-screen::after {
    background-position: -9vw 57%;
    background-size: min(96vw, 1320px) auto;
  }
  .view-host { padding: 20px 22px 42px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .kpi-grid.compact-kpis { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .kpi-card:nth-child(4), .kpi-card:nth-child(5) { min-height: 88px; }
  .overview-hero { grid-template-columns: minmax(310px, .78fr) minmax(460px, 1.22fr); }
  .hero-copy { padding: 38px; }
  .building-hero > img { width: 126%; }
  .floorplan-stage { padding-inline: 24px; }
}
@media (max-width: 1180px) {
  .auth-screen::after {
    background-position: -11vw 56%;
    background-size: min(108vw, 1180px) auto;
  }
  .asset-catalog { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .facility-grid { grid-template-columns: repeat(2,minmax(230px,1fr)); }
  .plan-intro { grid-template-columns: 1fr; }
  .plan-intro-steps { max-width: 700px; }
  .plan-collaboration { grid-template-columns: 1fr; }
  :root { --topbar: 74px; }
  .sidebar {
    z-index: 66;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 22px 0 70px rgba(0, 0, 0, .45);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid; }
  .app-shell.sidebar-open .sidebar-scrim { position: fixed; z-index: 65; inset: 0; display: block; background: rgba(1, 3, 9, .6); backdrop-filter: blur(2px); }
  .workspace { margin-left: 0; }
  .topbar { left: 0; padding-inline: 20px; }
  .overview-hero { grid-template-columns: minmax(300px, .88fr) minmax(390px, 1.12fr); }
  .hero-copy { padding: 30px; }
  .building-hero > img { right: -10%; width: 132%; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .floorplan-stage { min-height: 540px; }
  .floorplan { min-height: 410px; }
  .card-grid, .team-grid, .report-grid, .incident-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .employee-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .quick-export-grid, .role-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 960px) {
  .auth-screen::after {
    background-position: -17vw 56%;
    background-size: min(125vw, 1080px) auto;
    -webkit-mask-image: radial-gradient(ellipse 78% 78% at 28% 54%, #000 36%, rgba(0, 0, 0, .9) 52%, rgba(0, 0, 0, .38) 74%, transparent 100%);
    mask-image: radial-gradient(ellipse 78% 78% at 28% 54%, #000 36%, rgba(0, 0, 0, .9) 52%, rgba(0, 0, 0, .38) 74%, transparent 100%);
  }
  .global-search-shell { width: min(300px, 38vw); }
  .topbar-sync { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
  .topbar-sync > span { display: none; }
  .topbar-sync > b { position: absolute; top: -5px; right: -5px; border: 2px solid #0a0e1a; }
  .user-copy, .user-menu-button > svg { display: none; }
  .user-menu-button { min-width: 42px; padding: 0; border: 0; background: transparent; }
  .overview-hero { grid-template-columns: 1fr; }
  .overview-hero::after {
    background: linear-gradient(
      180deg,
      rgba(13, 17, 31, .99) 0%,
      rgba(13, 17, 31, .94) 38%,
      rgba(13, 17, 31, .58) 52%,
      rgba(13, 17, 31, .14) 67%,
      transparent 84%
    );
  }
  .hero-copy { padding-bottom: 12px; }
  .building-hero { min-height: 310px; padding: 0 18px 45px; }
  .building-hero > img { right: 50%; width: min(118%, 1100px); transform: translate(50%, -51%); }
  .dashboard-grid-2, .overview-layout { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .room-details { min-height: 0; }
  .floorplan-stage { min-height: 560px; }
  .analytics-grid > .dashboard-panel,
  .analytics-grid > .dashboard-panel.wide,
  .analytics-grid > .dashboard-panel.narrow { grid-column: span 12; }
  .analytics-grid > .dashboard-panel:nth-child(n) { grid-column: span 12; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-page { grid-template-columns: 1fr; }
  .recommendation-list { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .recommendation-list > .section-heading { grid-column: 1 / -1; }
  .ai-suggestions { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { grid-template-columns: repeat(4, minmax(100px, 1fr)); overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
  .organization-member-row { grid-template-columns: 34px minmax(150px,1fr) minmax(90px,.7fr) auto 34px; }
  .organization-member-row .member-department { display: none; }
  .integration-grid { grid-template-columns: 1fr; }
  .chat-page { grid-template-columns: 268px minmax(0,1fr); }
  .chat-management { display: none; }
}

/* Tablet and mobile */
@media (max-width: 820px) {
  .auth-screen::after {
    background-position: 50% 38%;
    background-size: max(760px, 155vw) auto;
    opacity: .56;
    -webkit-mask-image: radial-gradient(ellipse 105% 70% at 50% 40%, #000 30%, rgba(0, 0, 0, .84) 55%, transparent 100%);
    mask-image: radial-gradient(ellipse 105% 70% at 50% 40%, #000 30%, rgba(0, 0, 0, .84) 55%, transparent 100%);
  }
  .asset-catalog { grid-template-columns: 1fr; }
  .asset-view-toggle {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .asset-view-toggle button { min-height: 40px; }
  .asset-catalog.is-list .asset-catalog-card {
    min-height: 0;
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .asset-catalog.is-list .asset-card-visual .asset-card-open,
  .asset-catalog.is-list .asset-card-media { min-height: 122px; }
  .asset-catalog.is-list .asset-card-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 4px;
    padding: 11px 12px;
  }
  .asset-catalog.is-list .asset-card-category,
  .asset-catalog.is-list .asset-card-body > h2,
  .asset-catalog.is-list .asset-card-body > p,
  .asset-catalog.is-list .asset-card-reconciliation,
  .asset-catalog.is-list .asset-card-body dl {
    grid-column: 1;
    grid-row: auto;
  }
  .asset-catalog.is-list .asset-card-reconciliation small { display: none; }
  .asset-catalog.is-list .asset-card-body dl { gap: 3px; margin-top: 4px; }
  .asset-catalog.is-list .asset-card-body dl > div {
    grid-template-columns: minmax(66px, .7fr) minmax(0, 1fr);
    gap: 6px;
    padding-top: 4px;
  }
  .asset-catalog.is-list .asset-catalog-card > footer {
    grid-column: 1 / -1;
    padding: 9px;
    border-top: 1px solid rgba(151, 161, 196, .08);
    border-left: 0;
  }
  .facility-grid { grid-template-columns: 1fr; }
  :root { --topbar: 64px; }
  body { padding-bottom: 68px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .page-identity { flex: 1 1 auto; min-width: 0; }
  .page-identity > div { min-width: 0; }
  .page-identity p { display: none; }
  .page-identity h1 { font-size: 1rem; }
  .topbar-actions { flex: 0 0 auto; gap: 5px; }
  .global-search-shell {
    width: 38px;
    min-width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
  }
  .global-search-shell input, .global-search-shell kbd { display: none; }
  .quick-create { width: 38px; min-width: 38px; height: 38px; min-height: 38px; justify-content: center; padding: 0; }
  .quick-create > span { display: none; }
  .topbar-sync { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  .topbar .icon-button { width: 38px; height: 38px; }
  .user-menu-button { width: 36px; min-width: 36px; height: 36px; }
  .view-host { min-height: calc(100vh - var(--topbar) - 68px); padding: 15px 12px 28px; }
  .mobile-nav {
    position: fixed;
    z-index: 55;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: start;
    padding: 7px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line-strong);
    background: rgba(8, 11, 21, .96);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button {
    position: relative;
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .48rem;
  }
  .mobile-nav button svg { width: 20px; height: 20px; }
  .mobile-nav button.active { color: var(--violet-bright); }
  .mobile-nav button > i { position: absolute; top: -3px; right: calc(50% - 18px); min-width: 14px; height: 14px; display: grid; place-items: center; padding: 0 3px; border-radius: 8px; background: var(--red); color: white; font-size: .42rem; font-style: normal; }
  .mobile-nav .mobile-create { width: 42px; height: 42px; justify-self: center; margin-top: -19px; border: 4px solid #090d19; border-radius: 50%; background: linear-gradient(145deg, #8b72ff, #6344e9); color: white; box-shadow: 0 8px 24px rgba(91, 65, 218, .4); }
  .mobile-nav .mobile-create svg { width: 21px; height: 21px; }
  .app-shell.chat-route .topbar { display: none; }
  .app-shell.chat-route .view-host { min-height: calc(100dvh - 64px - env(safe-area-inset-bottom)); padding: 0; }
  .app-shell.chat-route .workspace { min-height: 100dvh; }
  .chat-page { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); min-height: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .chat-panel-channels .chat-sidebar { display: flex; }
  .chat-panel-channels .chat-conversation { display: none; }
  .chat-panel-conversation .chat-sidebar { display: none; }
  .chat-panel-conversation .chat-conversation { display: grid; }
  .chat-sidebar > header,.chat-conversation-head { min-height: 64px; padding-top: max(11px,env(safe-area-inset-top)); }
  .chat-back { display: grid; }
  .chat-message-list { padding: 13px 11px; }
  .chat-message { width: min(90%,680px); }
  .chat-compose { padding-inline: 10px; }
  .chat-compose-main { grid-template-columns: auto minmax(90px,1fr) auto; gap: 6px; }
  .chat-compose-tools { gap: 2px; }
  .chat-compose-tools .icon-button { width: 32px; height: 36px; }
  .chat-compose .button span { display: none; }
  .chat-compose .button { width: 42px; min-width: 42px; padding-inline: 0; }
  .chat-attachment-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chat-photo-card { min-height: 96px; }
  .chat-photo-card img { height: 126px; }
  .chat-reference-picker-controls { padding-inline: 12px; }
  .chat-settings-grid { grid-template-columns: 1fr; }
  .section-heading { min-height: 0; align-items: flex-start; flex-direction: column; gap: 13px; }
  .section-heading > div:last-child { width: 100%; justify-content: flex-start; }
  .section-heading h1 { font-size: 1.35rem; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
  .overview-hero { min-height: 0; }
  .hero-copy { padding: 24px 20px 6px; }
  .hero-copy h1 { font-size: 2.25rem; }
  .hero-copy p { font-size: .72rem; }
  .building-hero { min-height: 260px; padding: 0 2px 45px; }
  .building-hero > img { right: 50%; width: min(124%, 560px); transform: translate(50%, -51%); }
  .building-pin { padding: 5px 7px; font-size: .48rem; }
  .building-legend { right: 10px; left: 10px; justify-content: center; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.compact-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-width: 0; min-height: 90px; padding: 12px; }
  .kpi-grid .kpi-card:last-child { grid-column: 1 / -1; }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-card strong { font-size: 1.15rem; }
  .dashboard-grid-2 { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 1fr; }
  .plan-intro { min-height: 0; gap: 20px; padding: 21px 18px; }
  .plan-intro-steps { overflow-x: auto; padding-bottom: 5px; }
  .plan-intro-steps span { font-size: .52rem; }
  .plan-intro-steps b { width: 31px; height: 31px; }
  .plan-toolbar { align-items: stretch; flex-wrap: wrap; }
  .plan-toolbar > label { min-width: calc(50% - 5px); flex: 1; }
  .plan-toolbar select { width: 100%; min-width: 0; }
  .plan-toolbar-meta { order: 3; width: 100%; }
  .plan-toolbar > .button { margin-left: auto; }
  .plan-studio-shell { min-height: 520px; }
  .plan-context-card,.plan-chat-card { padding: 15px; }
  .plan-chat-actions { flex-wrap: wrap; }
  .plan-chat-actions .button:last-child { flex: 1; }
  .map-layout { min-height: auto; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar label { min-width: calc(50% - 5px); flex: 1; }
  .toolbar select { width: 100%; min-width: 0; }
  .toolbar-spacer { display: none; }
  .toolbar > .button { margin-left: auto; }
  .floorplan-stage { min-height: 480px; padding: 58px 12px 72px; }
  .floorplan { min-width: 620px; min-height: 360px; transform: scale(.72); transform-origin: center; }
  .floorplan-stage { overflow-x: auto; }
  .floorplan-legend { position: sticky; left: 0; width: max-content; max-width: 100%; gap: 10px; }
  .room-preview { grid-template-columns: 42px minmax(0, 1fr); }
  .room-preview > .status-badge { grid-column: 1 / -1; justify-self: start; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .filter-search { min-width: 100%; }
  .filter-bar select { min-width: 0; flex: 1; }
  .result-count { align-self: center; }
  .asset-date-filter-copy { width: 100%; padding-inline: 2px; }
  .asset-date-filter-bar .date-filter { flex: 1 1 158px; }
  .asset-sort-filter { width: 100%; min-width: 0; margin-left: 0; }
  .asset-day-heading { top: calc(var(--topbar) + 6px); }
  .data-table-wrap { border-radius: 13px; }
  .task-board, .kanban-board { grid-template-columns: repeat(4, 260px); }
  .card-grid, .team-grid, .report-grid, .incident-grid, .settings-grid { grid-template-columns: 1fr; }
  .employee-grid { grid-template-columns: 1fr; }
  .department-directory-head { align-items: flex-start; flex-direction: column; }
  .department-directory-head > .button { width: 100%; }
  .department-directory-access-note { max-width: none; text-align: left; }
  .quick-export-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-chat { min-height: calc(100vh - var(--topbar) - 110px); }
  .ai-command { min-height: calc(100vh - var(--topbar) - 110px); }
  .ai-command-head { grid-template-columns: 42px minmax(0,1fr); }
  .ai-online,.ai-status { grid-column: 2; min-width: 0; max-width: none; justify-items: start; text-align: left; }
  .ai-compose textarea { font-size: 16px; }
  .recommendation-list { grid-template-columns: 1fr; }
  .ai-suggestions { grid-template-columns: 1fr; }
  .chat-message { max-width: 90%; }
  .settings-nav { grid-template-columns: repeat(4, 140px); }
  .settings-nav { grid-auto-flow: column; grid-auto-columns: max-content; grid-template-columns: none; scroll-snap-type: x proximity; }
  .settings-nav > .section-kicker { display: none; }
  .settings-nav button { min-width: 138px; scroll-snap-align: start; }
  .role-grid { grid-template-columns: repeat(2, minmax(130px,1fr)); }
  .account-onboarding-page { align-self: start; }
  .account-onboarding-hero { grid-template-columns: 48px minmax(0,1fr); padding: 19px; }
  .account-onboarding-mark { width: 48px; height: 48px; }
  .account-onboarding-hero > .button { grid-column: 1 / -1; width: 100%; }
  .invitation-card { align-items: start; grid-template-columns: 38px minmax(0,1fr); }
  .invitation-card-actions,.invitation-revoke { grid-column: 1 / -1; justify-self: stretch; }
  .invitation-card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .invitation-card-actions .button,.invitation-revoke { width: 100%; }
  .organization-member-row { grid-template-columns: 34px minmax(0,1fr) auto; align-items: start; padding: 10px; }
  .organization-member-row .member-role { grid-column: 2; }
  .organization-member-row .member-department { display: block; grid-column: 2; }
  .organization-member-row > .invitation-status { grid-column: 3; grid-row: 1; }
  .organization-member-row > .icon-button { grid-column: 3; grid-row: 2 / span 2; }
  .profile-account-card { grid-template-columns: 48px minmax(0,1fr); }
  .profile-account-card > .button { grid-column: 1 / -1; width: 100%; }
  .field-app-promo { align-items: flex-start; flex-direction: column; }
  .field-app-promo .button { width: 100%; }
  .quick-create-menu { top: auto; right: 12px; bottom: 73px; }
  .user-popover { top: 58px; right: 8px; }
  .toast { right: 16px; bottom: 78px; }
  .auth-stage { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; padding: 20px; background: rgba(6, 9, 19, .9); backdrop-filter: blur(22px); }
  .auth-mobile-brand { display: flex; }
  .modal-card.asset-editor-modal { width: min(780px, 100%); height: min(88dvh, 900px); max-height: min(88dvh, 900px); }
  .asset-editor-workspace { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .asset-editor-media-panel { order: -1; flex: 0 0 auto; overflow: visible; border-left: 0; background: transparent; }
  .asset-editor-media-panel .asset-reference-panel { border-bottom: 1px solid var(--line); background: rgba(10, 15, 27, .62); }
  .asset-editor-form-panel { min-height: 0; flex: 0 0 auto; overflow: visible; }
  .asset-editor-form-panel > .entity-form { height: auto; overflow: visible; }
  .asset-editor-form-panel > .entity-form > .modal-actions { position: static; box-shadow: none; }
  .asset-modal-hero { grid-template-columns: 1fr; grid-template-areas: "photo" "summary"; align-items: stretch; padding: 16px 18px; }
  .asset-modal-state-badge { display: none; }
  .asset-modal-facts { display: none; }
  .asset-editor-media-panel .asset-photo-viewport,
  .asset-editor-media-panel .asset-photo-stage { min-height: 174px; }
  .asset-editor-media-panel .asset-photo-stage > img { height: 210px; }
  .asset-photo-stage,.asset-photo-stage > img { height: 210px; }
  .asset-custom-field-row { grid-template-columns: minmax(0,1fr) 112px; }
  .asset-custom-field-value { grid-column: 1 / -1; }
  .asset-custom-field-source { justify-self: start; }
  .asset-custom-field-remove { justify-self: end; }
}
@media (max-width: 500px) {
  .building-hero { min-height: 235px; }
  .asset-date-filter-bar .date-filter { width: 100%; min-width: 0; flex-basis: 100%; }
  .asset-day-groups { gap: 20px; }
  .asset-day-heading { min-height: 54px; padding: 9px 11px 9px 14px; }
  .asset-day-heading h2 { font-size: .74rem; }
  .building-hero > img { width: min(142%, 520px); }
  .building-pin {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .building-pin.pin-1 { left: 8%; top: 27%; }
  .building-pin.pin-2 { right: 6%; top: 33%; }
  .building-pin.pin-3 { left: 42%; bottom: 35%; }
  .building-pin.pin-4 { right: 11%; bottom: 27%; }
  .building-pin.pin-5 { left: 5%; bottom: 25%; }
  .building-legend { right: 8px; bottom: 10px; left: 8px; gap: 8px; }
  .form-media-row { grid-template-columns: 1fr; }
  .form-media-preview { width: 100%; height: 150px; }
  .form-plan-file { grid-template-columns: 1fr; }
  .plan-file-preview { min-height: 150px; }
  .media-source-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .media-source-actions .button { width: 100%; }
  .employee-card-actions { grid-template-columns: 1fr; }
  .department-directory-card { grid-template-columns: 5px minmax(0,1fr); }
  .department-directory-actions { grid-column: 2; width: 100%; }
  .department-directory-actions .button { flex: 1; }
  .department-directory-readonly { padding-left: 0; }
  .department-directory-empty { grid-template-columns: 32px minmax(0,1fr); }
  .department-directory-empty .button { grid-column: 1 / -1; width: 100%; }
  .chat-reference-picker-controls { grid-template-columns: 1fr; }
  .chat-reference-picker-results { max-height: 54vh; }
  .chat-reference-list.is-draft,.chat-draft-attachment-list { grid-template-columns: 1fr; }
  .chat-message { width: min(96%,680px); grid-template-columns: 30px minmax(0,1fr); gap: 6px; }
  .chat-message.is-mine { grid-template-columns: minmax(0,1fr) 30px; }
  .chat-message-avatar { width: 30px; height: 30px; }
  .chat-message > div { padding: 9px 10px; }
  .employee-modal-assets > header { align-items: flex-start; flex-direction: column; }
  .employee-modal-assets > header .button { width: 100%; }
  .plan-intro-steps { grid-template-columns: repeat(4, minmax(64px,1fr)); gap: 4px; }
  .plan-intro-steps i { display: none; }
  .plan-toolbar > label { min-width: 100%; }
  .plan-toolbar > .button { width: 100%; }
  .plan-context-heading { grid-template-columns: 42px minmax(0,1fr); }
  .plan-context-heading > .status-badge { grid-column: 1 / -1; justify-self: start; }
  .plan-context-icon { width: 42px; height: 42px; }
  .plan-context-stats { grid-template-columns: 1fr; }
  .plan-context-stats div + div { border-top: 1px solid var(--line); border-left: 0; }
  .plan-message { grid-template-columns: 32px minmax(0,1fr); gap: 7px; }
  .plan-message-avatar { width: 32px; height: 32px; }
  .plan-chat-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .plan-chat-actions .button { width: 100%; }
  .plan-chat-actions .button:last-child { grid-column: 1 / -1; margin-left: 0; }
  .sidebar { width: min(292px, calc(100vw - 38px)); }
  .view-host { padding-inline: 10px; }
  .kpi-grid { gap: 8px; }
  .kpi-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .kpi-delta { position: absolute; top: 13px; right: 12px; }
  .hero-actions .button { flex: 1; }
  .panel-header, .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-header > :last-child, .panel-head > :last-child { align-self: flex-end; }
  .details-list { grid-template-columns: 1fr; }
  .details-list div:nth-child(even) { padding-left: 0; }
  .panel-actions .button { flex: 1; }
  .metric-strip { grid-template-columns: 1fr; }
  .quick-export-grid, .role-grid, .settings-fields { grid-template-columns: 1fr; }
  .team-heading > div:last-child .button { width: 100%; }
  .pending-invitations-panel > header { align-items: flex-start; flex-direction: column; }
  .pending-invitations-panel > header .text-button { align-self: flex-end; }
  .users-summary-strip > div { grid-template-columns: 1fr; }
  .users-summary-strip span + span { border-top: 1px solid var(--line); border-left: 0; }
  .settings-section-action { align-items: flex-start; flex-direction: column; }
  .settings-section-action .button { width: 100%; }
  .invite-details-grid { grid-template-columns: 1fr; }
  .invite-details-grid .span-2 { grid-column: auto; }
  .invite-search-results { max-height: 190px; }
  .invitation-card-actions { grid-template-columns: 1fr; }
  .account-onboarding-hero { grid-template-columns: 1fr; text-align: left; }
  .account-onboarding-mark { width: 46px; height: 46px; }
  .account-onboarding-hero > .button { grid-column: auto; }
  .account-invitations-panel > header { align-items: flex-start; }
  .drawer { width: 100vw; }
  .settings-fields label.span-2 { grid-column: auto; }
  .integration-card { grid-template-columns: 34px minmax(0,1fr); }
  .integration-card .button { grid-column: 1 / -1; }
  .completion-ring { grid-template-columns: 1fr; justify-items: center; }
  .task-breakdown { width: 100%; }
  .resource-metric-grid { grid-template-columns: 1fr; }
  .panel-header > .panel-title-wrap,
  .panel-header > .panel-title-wrap:last-child { width: 100%; align-self: stretch; }
  .panel-total { justify-items: start; align-self: stretch; text-align: left; }
  .route-analytics .panel-body { padding: 15px; }
  .donut-layout { grid-template-columns: 1fr; }
  .donut-visual { width: 160px; }
  .ai-message { max-width: 96%; }
  .ai-compose { align-items: stretch; flex-direction: column; }
  .ai-compose .button { width: 100%; }
  .ai-fallback-note { align-items: stretch; flex-direction: column; }
  .ai-fallback-note .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .asset-location-grid { grid-template-columns: 1fr; }
  .employee-access-grid { grid-template-columns: 1fr; }
  .employee-access-heading { align-items: stretch; flex-direction: column; }
  .employee-access-count { align-self: flex-start; }
  .asset-location-picker legend { align-items: flex-start; flex-direction: column; gap: 2px; }
  .form-field.full, .form-grid .full { grid-column: auto; }
  .entity-form .span-2 { grid-column: auto; }
  .modal-root { padding: 8px; }
  .modal-dialog, .modal-card, .dialog-card { max-height: 94vh; border-radius: 14px; }
  .modal-root:has(.invite-employee-modal),.modal-root:has(.organization-create-modal) { padding: 0; }
  .invite-employee-modal,.organization-create-modal { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .invite-modal-body { padding: 14px 12px; }
  .invite-modal-actions { padding: 11px 12px max(11px,env(safe-area-inset-bottom)); }
  .invite-modal-actions .button { width: 100%; }
  .modal-footer .button { flex: 1; }
  .modal-actions .button { flex: 1; }
  .asset-modal-hero { grid-template-columns: 1fr; padding-inline: 12px; }
  .asset-modal-media { width: 100%; height: 150px; }
  .asset-editor-media-panel .asset-photo-viewport,
  .asset-editor-media-panel .asset-photo-stage { min-height: 180px; }
  .asset-editor-media-panel .asset-photo-stage > img { height: 180px; }
  .asset-photo-stage,.asset-photo-stage > img { height: 180px; min-height: 180px; }
  .asset-photo-viewport { min-height: 180px; }
  .asset-photo-add { min-width: 78px; }
  .asset-reference-panel { padding-inline: 12px; }
  .asset-reference-panel > header { align-items: stretch; flex-direction: column; }
  .asset-reference-panel .button { width: 100%; }
  .asset-reference-grid { grid-template-columns: 1fr; }
  .asset-custom-fields { padding: 11px; }
  .asset-custom-fields-head { align-items: stretch; flex-direction: column; }
  .asset-custom-fields-head .button { width: 100%; }
  .asset-custom-field-row { grid-template-columns: minmax(0,1fr) 36px; }
  .asset-custom-field-label,.asset-custom-field-type,.asset-custom-field-value { grid-column: 1 / -1; }
  .asset-custom-field-source { grid-column: 1; }
  .asset-custom-field-remove { grid-column: 2; }
  .palette-hint { display: none; }
  .search-palette { padding: 8px; place-items: start center; }
  .palette-card { margin-top: 8px; border-radius: 13px; }
}
/* Consumables / industrial stock control */
.consumables-page {
  --stock-grid: minmax(230px,1.45fr) minmax(150px,.8fr) minmax(180px,1fr) minmax(150px,.75fr) minmax(135px,.7fr) minmax(150px,.75fr) minmax(250px,1.2fr);
}
.consumables-heading > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.consumable-online-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(243,171,61,.3);
  border-radius: 13px;
  background: rgba(243,171,61,.08);
  color: var(--amber);
}
.consumable-online-notice > svg { flex: 0 0 auto; }
.consumable-online-notice div { display: grid; gap: 2px; }
.consumable-online-notice strong { font-size: .86rem; }
.consumable-online-notice span { color: #c3b28e; font-size: .78rem; line-height: 1.45; }
.consumable-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8,12,22,.72);
}
.consumable-tabs button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.consumable-tabs button.active {
  background: linear-gradient(135deg,rgba(128,103,255,.25),rgba(76,134,255,.12));
  box-shadow: inset 0 0 0 1px rgba(166,147,255,.24);
  color: var(--text);
}
.consumable-tabs svg { width: 17px; height: 17px; }
.consumables-catalog,.consumable-journal { display: grid; gap: 16px; }
.consumable-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}
.consumable-kpi-grid .kpi-card {
  min-height: 112px;
  background:
    linear-gradient(145deg,rgba(21,29,49,.94),rgba(12,17,30,.88)),
    repeating-linear-gradient(135deg,transparent 0 12px,rgba(255,255,255,.012) 12px 13px);
}
.consumable-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px,1.7fr) repeat(4,minmax(140px,.78fr)) auto;
  gap: 9px;
}
.consumable-filter-bar .result-count { align-self: center; white-space: nowrap; }
.consumable-table-wrap {
  border-color: rgba(151,161,196,.2);
  background: linear-gradient(180deg,rgba(17,23,39,.97),rgba(10,14,25,.97));
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
.consumable-table { min-width: 1230px; }
.consumable-table th,.consumable-journal-table th {
  height: 48px;
  color: #79849b;
  font-size: .66rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: rgba(8,12,22,.9);
}
.consumable-table td,.consumable-journal-table td { vertical-align: middle; }
.consumable-table tbody tr,.consumable-journal-table tbody tr { transition: background .18s,box-shadow .18s; }
.consumable-table tbody tr:hover,.consumable-journal-table tbody tr:hover { background: rgba(128,103,255,.045); }
.consumable-table tbody tr.stock-low { box-shadow: inset 3px 0 0 rgba(243,171,61,.7); }
.consumable-table tbody tr.stock-zero { box-shadow: inset 3px 0 0 rgba(255,95,114,.72); }
.consumable-name-button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.consumable-name-button strong { color: var(--text); font-size: .88rem; line-height: 1.3; }
.consumable-name-button small { color: var(--muted); font: 650 .69rem/1.25 ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing: .03em; }
.consumable-name-button:hover strong { color: var(--violet-bright); }
.consumable-name-button.compact { min-width: 180px; }
.consumable-location { display: flex; align-items: center; gap: 7px; color: #c1c8d9; }
.consumable-location svg { width: 16px; height: 16px; color: var(--blue); }
.consumable-quantity { display: block; color: #f9fafc; font: 760 1rem/1.2 ui-monospace,SFMono-Regular,Consolas,monospace; }
.consumable-quantity + small,.movement-quantity + small,.consumable-journal-table td > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .69rem;
}
.consumable-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 740;
  white-space: nowrap;
}
.consumable-stock-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.consumable-stock-badge.stock-ok { color: var(--green); background: rgba(77,213,145,.08); }
.consumable-stock-badge.stock-low { color: var(--amber); background: rgba(243,171,61,.08); }
.consumable-stock-badge.stock-zero { color: var(--red); background: rgba(255,95,114,.08); }
.consumable-row-actions { min-width: 240px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.button.button-small { min-height: 34px; padding: 0 11px; font-size: .73rem; }
.consumable-journal-filters {
  display: grid;
  grid-template-columns: minmax(170px,.7fr) minmax(240px,1.2fr) minmax(145px,.6fr) minmax(145px,.6fr) auto;
  gap: 9px;
}
.date-filter {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(19,25,43,.75);
}
.date-filter span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.date-filter input { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.consumable-journal-table { min-width: 1280px; }
.movement-type {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: .68rem;
  font-weight: 750;
  white-space: nowrap;
}
.movement-type.tone-success { color: var(--green); background: rgba(77,213,145,.1); }
.movement-type.tone-danger { color: var(--red); background: rgba(255,95,114,.1); }
.movement-type.tone-warning { color: var(--amber); background: rgba(243,171,61,.1); }
.movement-type.tone-accent { color: var(--violet-bright); background: rgba(128,103,255,.12); }
.movement-type.tone-muted { color: var(--muted); background: rgba(143,152,173,.1); }
.movement-quantity { display: block; font: 760 .9rem/1.2 ui-monospace,SFMono-Regular,Consolas,monospace; }
.movement-quantity.tone-success { color: var(--green); }
.movement-quantity.tone-danger { color: var(--red); }
.movement-quantity.tone-warning { color: var(--amber); }
.consumable-movement-row.is-highlighted {
  animation: consumable-highlight 2.6s ease-out;
  box-shadow: inset 0 0 0 1px rgba(166,147,255,.7);
}
@keyframes consumable-highlight {
  0%,35% { background: rgba(128,103,255,.2); }
  100% { background: transparent; }
}
.consumable-loading,.consumable-import-loading {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}
.consumable-loading > span,.consumable-import-loading > span,.consumable-mini-loader::before {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(166,147,255,.25);
  border-top-color: var(--violet-bright);
  border-radius: 50%;
  animation: consumable-spin .8s linear infinite;
}
@keyframes consumable-spin { to { transform: rotate(360deg); } }
.consumable-pagination { display: flex; justify-content: center; padding: 4px 0 10px; }
.consumable-card-modal { width: min(900px,calc(100vw - 32px)); }
.consumable-card-hero {
  margin: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(130deg,rgba(128,103,255,.12),transparent 55%),
    repeating-linear-gradient(135deg,rgba(255,255,255,.018) 0 1px,transparent 1px 11px),
    #0d1322;
}
.consumable-card-hero > div { display: flex; align-items: center; gap: 15px; }
.consumable-card-hero > div > div { display: grid; gap: 3px; }
.consumable-card-hero small { color: var(--muted); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; }
.consumable-card-hero strong { color: white; font: 800 1.9rem/1.05 ui-monospace,SFMono-Regular,Consolas,monospace; }
.consumable-card-hero span { color: var(--muted); font-size: .77rem; }
.consumable-card-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(166,147,255,.28);
  border-radius: 14px;
  background: rgba(128,103,255,.14);
  color: var(--violet-bright) !important;
}
.consumable-card-mark svg { width: 27px; height: 27px; }
.consumable-card-hero.stock-low { border-color: rgba(243,171,61,.28); }
.consumable-card-hero.stock-zero { border-color: rgba(255,95,114,.3); }
.consumable-inline-warning {
  margin: 12px 22px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(243,171,61,.08);
  color: #c8ae7d;
  font-size: .75rem;
}
.consumable-card-details {
  margin: 18px 22px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.consumable-card-details div { min-height: 74px; display: grid; align-content: center; gap: 5px; padding: 12px 15px; background: rgba(13,18,31,.66); }
.consumable-card-details div:nth-child(even) { border-left: 1px solid var(--line); }
.consumable-card-details div:nth-child(n+3) { border-top: 1px solid var(--line); }
.consumable-card-details .wide { grid-column: 1 / -1; border-left: 0 !important; }
.consumable-card-details dt { color: var(--muted); font-size: .66rem; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.consumable-card-details dd { margin: 0; color: #e5e8f1; font-size: .83rem; line-height: 1.45; }
.consumable-card-history { margin: 0 22px 20px; }
.consumable-card-history > header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.consumable-card-history h3 { margin: 3px 0 0; font-size: .94rem; }
.consumable-mini-loader { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .71rem; }
.consumable-mini-loader::before { content: ""; width: 14px; height: 14px; }
.consumable-card-movements {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.consumable-card-movements article {
  min-height: 66px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(10,15,27,.72);
}
.consumable-card-movements article + article { border-top: 1px solid var(--line); }
.consumable-card-movements article > div { min-width: 0; display: grid; gap: 3px; }
.consumable-card-movements strong { font-size: .78rem; }
.consumable-card-movements small { color: var(--muted); font-size: .69rem; }
.consumable-card-movements p { margin: 2px 0 0; overflow: hidden; color: #aab2c4; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.movement-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(128,103,255,.1);
}
.movement-icon svg { width: 17px; height: 17px; }
.movement-icon.tone-success { color: var(--green); background: rgba(77,213,145,.1); }
.movement-icon.tone-danger { color: var(--red); background: rgba(255,95,114,.1); }
.movement-icon.tone-warning { color: var(--amber); background: rgba(243,171,61,.1); }
.consumable-card-empty { padding: 22px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }
.consumable-card-actions { flex-wrap: wrap; }
.consumable-card-actions .button:first-child { margin-right: auto; }
.consumable-editor-modal,.consumable-movement-modal { width: min(760px,calc(100vw - 32px)); }
.consumable-editor-modal .form-grid,.consumable-movement-modal .form-grid { padding: 0 22px; }
.consumable-editor-modal .form-grid .wide,.consumable-movement-modal .form-grid .wide { grid-column: 1 / -1; }
.consumable-editor-modal label small,.consumable-movement-modal label small { color: var(--muted); font-size: .68rem; line-height: 1.4; }
.consumable-import-modal { width: min(1040px,calc(100vw - 32px)); }
.consumable-import-summary { margin: 0 22px 14px; }
.consumable-import-table { max-height: min(55vh,520px); margin: 0 22px; }
.consumable-import-table .data-table { min-width: 760px; }
.consumable-import-table td strong,.consumable-import-table td small { display: block; }
.consumable-import-table td small { margin-top: 3px; color: var(--muted); }
.consumable-import-table tr.is-invalid { background: rgba(255,95,114,.04); }
.import-ok { color: var(--green); font-size: .73rem; font-weight: 740; }
.import-error { display: block; max-width: 300px; color: var(--red); font-size: .7rem; line-height: 1.4; }

@media (max-width: 1180px) {
  .consumable-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .consumable-filter-bar { grid-template-columns: minmax(240px,1.5fr) repeat(2,minmax(150px,1fr)); }
  .consumable-filter-bar .result-count { justify-self: end; }
  .consumable-journal-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .consumable-journal-filters .button { grid-column: 2; justify-self: end; }
}
@media (max-width: 720px) {
  .consumables-heading > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .consumables-heading > div:last-child .button { width: 100%; }
  .consumables-heading > div:last-child .button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .consumable-tabs { width: 100%; }
  .consumable-tabs button { flex: 1; justify-content: center; padding-inline: 8px; }
  .consumable-filter-bar,.consumable-journal-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .consumable-filter-bar .filter-search,.consumable-filter-bar .result-count,.consumable-journal-filters > select:nth-child(2) { grid-column: 1 / -1; }
  .consumable-journal-filters .button { grid-column: 1 / -1; width: 100%; }
  .consumable-card-hero { align-items: flex-start; flex-direction: column; }
  .consumable-card-details { grid-template-columns: 1fr; }
  .consumable-card-details div:nth-child(even) { border-left: 0; }
  .consumable-card-details div:nth-child(n+2) { border-top: 1px solid var(--line); }
  .consumable-card-details .wide { grid-column: auto; }
  .consumable-card-actions .button { flex: 1 1 calc(50% - 8px); }
  .consumable-card-actions .button:first-child { margin-right: 0; }
}
@media (max-width: 500px) {
  .consumables-page { gap: 12px; }
  .consumables-heading > div:last-child,.consumable-filter-bar,.consumable-journal-filters { grid-template-columns: 1fr; }
  .consumables-heading > div:last-child .button,.consumables-heading > div:last-child .button:last-child:nth-child(odd),.consumable-filter-bar .filter-search,.consumable-filter-bar .result-count,.consumable-journal-filters > select:nth-child(2) { grid-column: auto; }
  .consumable-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .consumable-kpi-grid .kpi-card { min-height: 104px; }
  .consumable-online-notice { align-items: flex-start; }
  .consumable-tabs button { font-size: .74rem; }
  .consumable-card-modal,.consumable-editor-modal,.consumable-movement-modal,.consumable-import-modal { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .consumable-card-hero,.consumable-card-details,.consumable-card-history,.consumable-import-summary,.consumable-import-table { margin-inline: 12px; }
  .consumable-card-hero > div { align-items: flex-start; }
  .consumable-card-mark { width: 44px; height: 44px; }
  .consumable-card-hero strong { font-size: 1.55rem; }
  .consumable-editor-modal .form-grid,.consumable-movement-modal .form-grid { padding-inline: 12px; }
  .consumable-card-actions .button { flex-basis: 100%; }
}

/* Interactive document library */
.documents-page { gap: 18px; }
.documents-heading { align-items: flex-end; }
.document-access-denied {
  min-height: min(560px,calc(100dvh - var(--topbar) - 48px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 0,rgba(128,103,255,.09),transparent 28rem),rgba(10,14,25,.78);
}
.document-access-denied > span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(128,103,255,.22);
  border-radius: 18px;
  background: rgba(128,103,255,.09);
  color: var(--violet-bright);
}
.document-access-denied > span svg { width: 28px; height: 28px; }
.document-access-denied > div { max-width: 560px; }
.document-access-denied h1 { margin: 0; font-size: clamp(1.4rem,3vw,2rem); letter-spacing: -.04em; }
.document-access-denied p { margin: 8px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.document-online-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(243,171,61,.2);
  border-radius: 11px;
  background: rgba(243,171,61,.06);
  color: #cdb47f;
  font-size: .74rem;
}
.document-online-notice svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--amber); }
.document-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}
.document-kpi-grid .kpi-card { min-height: 112px; }
.document-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.document-search { width: min(620px,100%); min-width: min(360px,100%); }
.document-search kbd { margin-left: auto; }
.document-load-state,.document-load-error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .7rem;
}
.document-load-state > i {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(166,147,255,.2);
  border-top-color: var(--violet-bright);
  border-radius: 50%;
  animation: consumable-spin .8s linear infinite;
}
.document-load-state.is-ready { color: #7fae97; }
.document-load-state.is-ready svg { width: 15px; height: 15px; color: var(--green); }
.document-load-error { color: #e397a1; cursor: pointer; }
.document-load-error svg { width: 15px; height: 15px; color: var(--red); }
.document-workspace {
  display: grid;
  grid-template-columns: minmax(220px,252px) minmax(440px,1fr) minmax(270px,320px);
  align-items: start;
  gap: 14px;
}
.document-tree-panel,.document-main-panel,.document-inspector {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.018),transparent 110px),
    rgba(10,14,25,.82);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.document-tree-panel {
  position: sticky;
  top: calc(var(--topbar) + 14px);
  overflow: hidden;
}
.document-tree-panel > header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.document-tree-panel > header h2 {
  margin: 2px 0 0;
  font-size: .93rem;
  letter-spacing: -.02em;
}
.document-tree-panel > header .section-kicker { margin-bottom: 2px; font-size: .56rem; }
.document-tree-panel > header .icon-button { width: 32px; height: 32px; }
.document-tree {
  max-height: calc(100dvh - var(--topbar) - 220px);
  overflow: auto;
  padding: 9px;
}
.document-tree-item { min-width: 0; }
.document-folder-tone-violet { --folder-color: #8067ff; }
.document-folder-tone-blue { --folder-color: #3b82f6; }
.document-folder-tone-cyan { --folder-color: #22d3ee; }
.document-folder-tone-green { --folder-color: #22c55e; }
.document-folder-tone-amber { --folder-color: #f59e0b; }
.document-folder-tone-rose { --folder-color: #fb7185; }
.document-tree-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto 28px;
  align-items: center;
  gap: 2px;
  border-radius: 9px;
  transition: background .18s,color .18s;
}
.document-tree-item.is-root > .document-tree-row { grid-template-columns: 26px minmax(0,1fr); }
.document-tree-item.is-selected > .document-tree-row {
  background: color-mix(in srgb,var(--folder-color,var(--violet)) 10%,transparent);
  box-shadow: inset 2px 0 var(--folder-color,var(--violet));
}
.document-tree-toggle,.document-tree-edit,.document-tree-select {
  border: 0;
  background: transparent;
  color: inherit;
}
.document-tree-toggle {
  width: 24px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted-2);
}
.document-tree-toggle svg { width: 12px; height: 12px; transition: transform .18s; }
.document-tree-item[aria-expanded="true"] > .document-tree-row .document-tree-toggle svg { transform: rotate(90deg); }
.document-tree-toggle:disabled { opacity: .36; cursor: default; }
.document-tree-select {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  text-align: left;
}
.document-tree-select > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--folder-color,var(--violet-bright)); }
.document-tree-select > span { min-width: 0; flex: 1; overflow: hidden; color: #b9c0cf; font-size: .72rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.document-tree-select > b { min-width: 20px; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,.04); color: var(--muted-2); font-size: .58rem; text-align: center; }
.document-tree-item.is-selected > .document-tree-row .document-tree-select > span { color: #eeedf8; }
.document-tree-edit {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity .18s,background .18s,color .18s;
}
.document-tree-row:hover .document-tree-edit,.document-tree-edit:focus-visible { opacity: 1; }
.document-tree-edit:hover { background: rgba(128,103,255,.1); color: var(--violet-bright); }
.document-tree-edit svg { width: 13px; height: 13px; }
.document-tree-group {
  margin-left: 11px;
  padding-left: 9px;
  border-left: 1px solid rgba(128,103,255,.13);
}
.document-tree-empty {
  display: grid;
  gap: 10px;
  margin: 4px 10px 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.document-tree-empty p { margin: 0; font-size: .67rem; line-height: 1.5; }
.document-main-panel { overflow: hidden; }
.document-breadcrumbs {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.document-breadcrumbs::-webkit-scrollbar { display: none; }
.document-breadcrumbs button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  padding: 0 7px;
  background: transparent;
  color: var(--muted);
  font-size: .67rem;
}
.document-breadcrumbs button:hover,.document-breadcrumbs button[aria-current="page"] { background: rgba(128,103,255,.08); color: #dbd9e9; }
.document-breadcrumbs button svg { width: 14px; height: 14px; }
.document-breadcrumbs > span { display: grid; place-items: center; color: var(--muted-2); }
.document-breadcrumbs > span svg { width: 10px; height: 10px; }
.document-folder-map {
  position: relative;
  margin: 14px;
  overflow: hidden;
  border: 1px solid rgba(128,103,255,.16);
  border-radius: 15px;
  background:
    radial-gradient(circle at 18% 10%,rgba(128,103,255,.1),transparent 24rem),
    linear-gradient(rgba(128,103,255,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(128,103,255,.025) 1px,transparent 1px),
    rgba(9,13,24,.75);
  background-size: auto,24px 24px,24px 24px,auto;
}
.document-folder-map-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}
.document-current-node {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}
.document-current-node > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb,var(--folder-color) 32%,transparent);
  border-radius: 14px;
  background: color-mix(in srgb,var(--folder-color) 11%,rgba(9,13,24,.9));
  color: var(--folder-color);
  box-shadow: 0 12px 28px color-mix(in srgb,var(--folder-color) 12%,transparent);
}
.document-current-node > span svg { width: 23px; height: 23px; }
.document-current-node > div { min-width: 0; display: grid; gap: 3px; }
.document-current-node small { color: var(--folder-color); font-size: .55rem; font-weight: 750; letter-spacing: .1em; }
.document-current-node strong { overflow: hidden; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.document-current-node p { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.document-folder-branches {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(170px,100%),1fr));
  gap: 9px;
  padding: 17px 16px 16px;
  border-top: 1px solid rgba(128,103,255,.1);
}
.document-folder-branches::before {
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(128,103,255,.45),transparent);
  content: "";
}
.document-folder-node {
  position: relative;
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 13px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: rgba(14,19,32,.84);
  color: inherit;
  text-align: left;
  transition: transform .18s,border-color .18s,background .18s;
}
.document-folder-node::before {
  position: absolute;
  top: -18px;
  left: 25px;
  width: 1px;
  height: 18px;
  background: color-mix(in srgb,var(--folder-color) 40%,transparent);
  content: "";
}
.document-folder-node:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--folder-color) 38%,transparent); background: rgba(20,26,43,.96); }
.document-folder-node > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb,var(--folder-color) 10%,transparent);
  color: var(--folder-color);
}
.document-folder-node > span svg { width: 16px; height: 16px; }
.document-folder-node > .o360-sync-receipt-slot {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  height: auto;
  min-height: 18px;
  display: flex;
  place-items: initial;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.document-folder-node > .o360-sync-receipt-slot + svg { grid-column: 3; grid-row: 1 / 3; }
.document-folder-node strong { min-width: 0; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.document-folder-node small { min-width: 0; overflow: hidden; color: var(--muted); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.document-folder-node > svg { grid-column: 3; grid-row: 1 / 3; width: 12px; height: 12px; color: var(--muted-2); }
.document-folder-map-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px 16px;
  border-top: 1px solid rgba(128,103,255,.1);
  color: var(--muted);
}
.document-folder-map-empty > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(128,103,255,.08);
  color: var(--violet-bright);
}
.document-folder-map-empty svg { width: 14px; height: 14px; }
.document-folder-map-empty p { max-width: 620px; margin: 0; font-size: .64rem; line-height: 1.5; }
.document-search-summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(76,134,255,.18);
  border-radius: 13px;
  background: rgba(76,134,255,.055);
}
.document-search-summary > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(76,134,255,.1);
  color: #75a2ff;
}
.document-search-summary > span svg { width: 17px; height: 17px; }
.document-search-summary > div { min-width: 0; flex: 1; display: grid; gap: 4px; }
.document-search-summary strong { font-size: .75rem; }
.document-search-summary small { overflow: hidden; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.document-list-section { padding: 3px 14px 16px; }
.document-list-section > header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.document-list-section > header h2 { margin: 2px 0 0; font-size: .88rem; }
.document-list-section > header .section-kicker { margin: 0; font-size: .55rem; }
.document-list-section > header > span { min-width: 28px; padding: 4px 7px; border-radius: 8px; background: rgba(128,103,255,.08); color: var(--violet-bright); font-size: .63rem; text-align: center; }
.document-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr));
  gap: 10px;
}
.document-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(13,18,31,.76);
  transition: transform .18s,border-color .18s,box-shadow .18s;
}
.document-card:hover { transform: translateY(-2px); border-color: rgba(128,103,255,.26); }
.document-card.is-selected { border-color: rgba(128,103,255,.52); box-shadow: 0 0 0 3px rgba(128,103,255,.07),0 14px 36px rgba(0,0,0,.18); }
.document-card-main {
  width: 100%;
  min-height: 84px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 13px;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.document-type-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128,103,255,.18);
  border-radius: 11px;
  background: rgba(128,103,255,.08);
  color: var(--violet-bright);
}
.document-type-mark.type-plan { color: var(--blue); background: rgba(76,134,255,.08); border-color: rgba(76,134,255,.18); }
.document-type-mark.type-contract { color: var(--cyan); background: rgba(66,201,233,.07); border-color: rgba(66,201,233,.16); }
.document-type-mark.type-passport { color: var(--green); background: rgba(77,213,145,.07); border-color: rgba(77,213,145,.16); }
.document-type-mark.type-act { color: var(--amber); background: rgba(243,171,61,.07); border-color: rgba(243,171,61,.16); }
.document-type-mark svg { width: 19px; height: 19px; }
.document-card-copy { min-width: 0; display: grid; gap: 3px; }
.document-card-copy small { overflow: hidden; color: var(--muted-2); font-size: .55rem; font-weight: 700; letter-spacing: .045em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.document-card-copy strong { overflow: hidden; color: #e9eaf2; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.document-card-copy > span { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.document-card-main > svg { width: 12px; height: 12px; color: var(--muted-2); }
.document-card-links {
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 6px 11px;
  border-top: 1px solid rgba(151,161,196,.09);
  background: rgba(7,11,20,.35);
}
.document-card-links > span {
  min-width: 0;
  max-width: 42%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(128,103,255,.12);
  border-radius: 99px;
  padding: 4px 7px;
  background: rgba(128,103,255,.05);
  color: #a7a7ba;
  font-size: .54rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-card-links > span svg { width: 10px; height: 10px; flex: 0 0 auto; color: var(--violet-bright); }
.document-card-links > span.is-empty { max-width: none; border-color: transparent; background: transparent; color: var(--muted-2); }
.document-card > footer {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 11px;
  border-top: 1px solid rgba(151,161,196,.09);
  color: var(--muted-2);
  font-size: .57rem;
}
.document-card > footer > span:nth-child(2) { margin-left: auto; }
.document-card > footer .icon-button { width: 29px; height: 29px; flex: 0 0 auto; }
.document-card > footer .icon-button svg { width: 14px; height: 14px; }
.document-card > footer > .o360-sync-receipt-slot { flex: 0 1 auto; }
.document-expiry { display: inline-flex; align-items: center; gap: 4px; }
.document-expiry svg { width: 11px; height: 11px; }
.document-no-file { margin-left: auto; color: #a78f65 !important; }
.document-empty { min-height: 250px; }
.document-inspector {
  position: sticky;
  top: calc(var(--topbar) + 14px);
  overflow: hidden;
}
.document-inspector > header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 0 0,rgba(128,103,255,.1),transparent 18rem);
}
.document-inspector-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(128,103,255,.18);
  border-radius: 11px;
  background: rgba(128,103,255,.09);
  color: var(--violet-bright);
}
.document-inspector-icon svg { width: 19px; height: 19px; }
.document-inspector > header > div { min-width: 0; display: grid; gap: 4px; }
.document-inspector > header small { color: var(--violet-bright); font-size: .55rem; font-weight: 730; letter-spacing: .08em; text-transform: uppercase; }
.document-inspector h2 { margin: 0; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.25; letter-spacing: -.02em; }
.document-inspector > header p { margin: 1px 0 0; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.document-inspector-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-bottom: 1px solid var(--line); }
.document-inspector-meta > div { min-width: 0; display: grid; gap: 4px; padding: 11px 13px; }
.document-inspector-meta > div:nth-child(even) { border-left: 1px solid var(--line); }
.document-inspector-meta > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.document-inspector-meta dt { color: var(--muted-2); font-size: .53rem; font-weight: 710; letter-spacing: .07em; text-transform: uppercase; }
.document-inspector-meta dd { margin: 0; overflow: hidden; color: #cfd2de; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.document-relations { padding: 13px; }
.document-inspector-section-head > div { display: flex; align-items: center; justify-content: space-between; }
.document-inspector-section-head .section-kicker { margin: 0; font-size: .54rem; }
.document-inspector-section-head b { color: var(--violet-bright); font-size: .65rem; }
.document-relation-list { display: grid; gap: 6px; margin-top: 9px; }
.document-relation-list > button {
  min-width: 0;
  min-height: 51px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  background: rgba(14,19,33,.7);
  color: inherit;
  text-align: left;
}
.document-relation-list > button:hover { border-color: rgba(128,103,255,.3); background: rgba(22,27,46,.9); }
.document-relation-list > button > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(128,103,255,.08); color: var(--violet-bright); }
.document-relation-list > button > span:first-child svg { width: 15px; height: 15px; }
.document-relation-list > button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.document-relation-list strong,.document-relation-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-relation-list strong { font-size: .65rem; }
.document-relation-list small { color: var(--muted); font-size: .56rem; }
.document-relation-list > button > svg { width: 11px; height: 11px; color: var(--muted-2); }
.document-relation-list > p { margin: 4px 0; color: var(--muted); font-size: .64rem; line-height: 1.5; }
.document-inspector > footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.document-inspector > footer .button:only-child { grid-column: 1 / -1; }
.document-inspector-empty {
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}
.document-inspector-empty .document-inspector-orbit {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128,103,255,.2);
  border-radius: 50%;
  background: radial-gradient(circle,rgba(128,103,255,.16),rgba(128,103,255,.03));
  color: var(--violet-bright);
  box-shadow: 0 0 0 9px rgba(128,103,255,.025),0 0 36px rgba(128,103,255,.12);
}
.document-inspector-empty .document-inspector-orbit svg { width: 23px; height: 23px; }
.document-inspector-empty h2 { font-size: .9rem; }
.document-inspector-empty p { max-width: 240px; margin: 0; color: var(--muted); font-size: .65rem; line-height: 1.55; }
.document-folder-modal { width: min(680px,calc(100vw - 32px)); }
.document-folder-form-hero,.document-existing-file {
  margin: 0 22px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb,var(--folder-color,var(--violet)) 22%,var(--line));
  border-radius: 13px;
  background: color-mix(in srgb,var(--folder-color,var(--violet)) 7%,rgba(10,15,27,.78));
}
.document-folder-form-hero > span,.document-existing-file > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: color-mix(in srgb,var(--folder-color,var(--violet)) 11%,transparent);
  color: var(--folder-color,var(--violet-bright));
}
.document-folder-form-hero > span svg,.document-existing-file > span svg { width: 20px; height: 20px; }
.document-folder-form-hero > div,.document-existing-file > div { min-width: 0; flex: 1; display: grid; gap: 4px; }
.document-folder-form-hero strong,.document-existing-file strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.document-folder-form-hero small,.document-existing-file small { color: var(--muted); font-size: .64rem; line-height: 1.45; }
.document-folder-modal .form-grid,.document-editor-modal .document-form-grid { padding: 0 22px; }
.document-folder-modal .form-grid .full,.document-editor-modal .document-form-grid .full { grid-column: 1 / -1; }
.document-editor-modal { width: min(900px,calc(100vw - 32px)); }
.document-file-drop {
  min-height: 142px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin: 0 22px 16px;
  border: 1px dashed rgba(128,103,255,.34);
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 0,rgba(128,103,255,.11),transparent 12rem),
    rgba(9,13,24,.7);
  color: var(--muted);
  text-align: center;
  transition: border-color .18s,background .18s,transform .18s;
  cursor: pointer;
}
.document-file-drop:hover,.document-file-drop.is-dragover { border-color: var(--violet-bright); background-color: rgba(128,103,255,.07); }
.document-file-drop.is-dragover { transform: scale(.995); }
.document-file-drop.has-file { border-style: solid; border-color: rgba(77,213,145,.34); background-color: rgba(77,213,145,.035); }
.document-file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.document-file-drop > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(128,103,255,.11); color: var(--violet-bright); }
.document-file-drop > span svg { width: 20px; height: 20px; }
.document-file-drop strong { color: #dfe1ea; font-size: .8rem; }
.document-file-drop small { max-width: 90%; overflow-wrap: anywhere; font-size: .65rem; }
.document-link-builder {
  margin: 18px 22px 2px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9,13,24,.62);
}
.document-link-builder > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.document-link-builder h3 { margin: 2px 0 0; font-size: .84rem; }
.document-link-builder header p { margin: 5px 0 0; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.document-link-builder header b { min-width: 42px; padding: 5px 7px; border-radius: 8px; background: rgba(128,103,255,.08); color: var(--violet-bright); font-size: .64rem; text-align: center; }
.document-link-controls {
  display: grid;
  grid-template-columns: minmax(150px,.72fr) minmax(220px,1.28fr) auto;
  gap: 8px;
  margin: 13px 0;
}
.document-link-controls select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #0d1322;
  color: #d9dbe5;
  font-size: .68rem;
}
.document-link-drafts { display: flex; flex-wrap: wrap; gap: 7px; }
.document-link-drafts > span {
  max-width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) 24px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(128,103,255,.15);
  border-radius: 10px;
  padding: 5px 5px 5px 7px;
  background: rgba(128,103,255,.055);
}
.document-link-drafts > span > i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(128,103,255,.08); color: var(--violet-bright); }
.document-link-drafts > span > i svg { width: 13px; height: 13px; }
.document-link-drafts > span > span { min-width: 0; display: grid; gap: 2px; }
.document-link-drafts strong,.document-link-drafts small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-link-drafts strong { font-size: .63rem; }
.document-link-drafts small { color: var(--muted); font-size: .53rem; }
.document-link-drafts button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; padding: 0; background: transparent; color: var(--muted-2); }
.document-link-drafts button:hover { background: rgba(255,95,114,.08); color: var(--red); }
.document-link-drafts button svg { width: 12px; height: 12px; }
.document-link-drafts > p { margin: 0; color: var(--muted-2); font-size: .62rem; }

@media (max-width: 1380px) {
  .document-workspace { grid-template-columns: minmax(210px,240px) minmax(0,1fr); }
  .document-inspector { position: static; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(260px,.8fr) minmax(320px,1.2fr); }
  .document-inspector > header { border-right: 1px solid var(--line); }
  .document-inspector-meta { border-right: 1px solid var(--line); }
  .document-relations { grid-column: 2; grid-row: 1 / span 2; }
  .document-inspector > footer { grid-column: 1 / -1; }
  .document-inspector-empty { display: none; }
}
@media (max-width: 1060px) {
  .document-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .document-workspace { grid-template-columns: 1fr; }
  .document-tree-panel { position: static; }
  .document-tree { max-height: 310px; }
  .document-main-panel { min-height: 480px; }
  .document-inspector { grid-column: auto; }
  .document-tree-edit { opacity: 1; }
}
@media (max-width: 720px) {
  .documents-heading > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .documents-heading .button { width: 100%; padding-inline: 10px; }
  .document-search-row { align-items: stretch; flex-direction: column; }
  .document-search { min-width: 100%; }
  .document-load-state,.document-load-error { min-height: 28px; align-self: flex-start; text-align: left; }
  .document-folder-map-head { align-items: flex-start; flex-direction: column; }
  .document-folder-map-head > .button { width: 100%; }
  .document-folder-branches { grid-template-columns: 1fr; }
  .document-card-grid { grid-template-columns: 1fr; }
  .document-inspector { display: block; }
  .document-inspector > header { border-right: 0; }
  .document-inspector-meta { border-right: 0; }
  .document-relations { grid-column: auto; grid-row: auto; }
  .document-link-controls { grid-template-columns: 1fr 1fr; }
  .document-link-controls .button { grid-column: 1 / -1; }
  .document-existing-file { align-items: flex-start; flex-wrap: wrap; }
  .document-existing-file .button { width: 100%; }
}
@media (max-width: 500px) {
  .documents-page { gap: 12px; }
  .document-access-denied { align-items: flex-start; flex-direction: column; justify-content: center; padding: 24px 20px; }
  .document-kpi-grid { gap: 8px; }
  .document-kpi-grid .kpi-card { min-height: 104px; }
  .documents-heading > div:last-child { grid-template-columns: 1fr; }
  .document-folder-map,.document-search-summary { margin: 9px; }
  .document-list-section { padding: 3px 9px 12px; }
  .document-folder-map-head { padding: 13px; }
  .document-folder-branches { padding: 17px 12px 12px; }
  .document-current-node > span { width: 42px; height: 42px; }
  .document-current-node strong { font-size: .82rem; }
  .document-breadcrumbs { padding-inline: 8px; }
  .document-inspector > footer { grid-template-columns: 1fr; }
  .document-inspector > footer .button { grid-column: auto; width: 100%; }
  .document-folder-modal,.document-editor-modal { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .document-folder-form-hero,.document-existing-file,.document-file-drop,.document-link-builder { margin-inline: 12px; }
  .document-folder-modal .form-grid,.document-editor-modal .document-form-grid { padding-inline: 12px; }
  .document-link-builder { padding: 12px; }
  .document-link-controls { grid-template-columns: 1fr; }
  .document-link-controls .button { grid-column: auto; }
}

/* Maintenance incident workflow */
.chat-conversation.is-maintenance {
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 12% 4%, rgba(83, 224, 255, .08), transparent 28rem),
    radial-gradient(circle at 88% 0, rgba(128, 103, 255, .13), transparent 32rem),
    #090d18;
}
.chat-incident-feed { gap: 16px; padding: 20px; }
.chat-incident-feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 2px;
}
.chat-incident-feed-head h3 { margin: 5px 0 0; font-size: .82rem; }
.chat-incident-feed-head p { max-width: 300px; margin: 0; color: var(--muted); font-size: .53rem; line-height: 1.55; text-align: right; }
.chat-incident-feed-list { display: grid; align-content: start; gap: 10px; }
.chat-incident-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(128, 103, 255, .16);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(18, 24, 42, .94), rgba(9, 14, 26, .96));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .14);
}
.chat-incident-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: #8f7aff;
  box-shadow: 0 0 18px rgba(143, 122, 255, .7);
}
.chat-incident-card.severity-low::before { background: #53d99b; box-shadow: 0 0 18px rgba(83, 217, 155, .55); }
.chat-incident-card.severity-high::before { background: #ffad4d; box-shadow: 0 0 18px rgba(255, 173, 77, .58); }
.chat-incident-card.severity-critical::before { background: #ff6177; box-shadow: 0 0 18px rgba(255, 97, 119, .64); }
.chat-incident-card-main {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 16px 14px 17px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background .18s ease, transform .18s ease;
}
.chat-incident-card-main:hover { background: linear-gradient(90deg, rgba(128, 103, 255, .075), rgba(83, 224, 255, .025)); }
.chat-incident-card-main:active { transform: scale(.996); }
.chat-incident-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 122, 255, .2);
  border-radius: 13px;
  background: rgba(128, 103, 255, .1);
  color: #ad9fff;
}
.chat-incident-card-icon svg { width: 21px; height: 21px; }
.chat-incident-card-copy { min-width: 0; display: grid; gap: 6px; }
.chat-incident-card-copy > strong { overflow: hidden; color: #f1f2f8; font-size: .7rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.chat-incident-card-copy > p { max-width: 820px; margin: 0; overflow: hidden; color: #aeb5c7; font-size: .56rem; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.chat-incident-card-top, .chat-incident-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.chat-incident-card-meta em { display: inline-flex; align-items: center; gap: 4px; color: var(--muted-2); font-size: .47rem; font-style: normal; }
.chat-incident-card-meta svg { width: 12px; height: 12px; }
.chat-incident-card-open { display: inline-flex; align-items: center; gap: 5px; color: #a899ff; font-size: .52rem; font-weight: 700; white-space: nowrap; }
.chat-incident-card-open svg { width: 13px; height: 13px; }
.chat-incident-empty { margin: auto; }

.incident-wizard-modal { width: min(1120px, 100%); height: min(91dvh, 920px); max-height: min(91dvh, 920px); }
.incident-wizard-head { flex: 0 0 auto; }
.incident-wizard-head h2 { margin: 5px 0 0; }
.incident-wizard-progress {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(44px, 1fr) auto minmax(44px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-bottom: 1px solid rgba(128, 103, 255, .13);
  background: linear-gradient(90deg, rgba(128, 103, 255, .055), rgba(83, 224, 255, .025));
}
.incident-wizard-progress > span { display: flex; align-items: center; gap: 8px; color: var(--muted-2); }
.incident-wizard-progress b {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #0b1020;
  color: var(--muted);
  font-size: .55rem;
  box-shadow: 0 0 0 4px rgba(8, 12, 23, .8);
}
.incident-wizard-progress b svg { width: 13px; height: 13px; }
.incident-wizard-progress em { font-size: .52rem; font-style: normal; font-weight: 750; letter-spacing: .04em; }
.incident-wizard-progress i { height: 1px; background: linear-gradient(90deg, rgba(128, 103, 255, .3), rgba(83, 224, 255, .18)); }
.incident-wizard-progress .is-active { color: #ddd8ff; }
.incident-wizard-progress .is-active b { border-color: rgba(158, 140, 255, .65); background: linear-gradient(145deg, #8c73ff, #5c45d3); color: white; box-shadow: 0 0 0 4px rgba(128, 103, 255, .09), 0 0 25px rgba(128, 103, 255, .35); }
.incident-wizard-progress .is-complete b { border-color: rgba(83, 224, 255, .46); background: rgba(31, 126, 150, .32); color: #70e8ff; }
.incident-wizard-form { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.incident-wizard-stage { min-height: 0; flex: 1; overflow-y: auto; padding: 20px 24px; scrollbar-gutter: stable; }
.incident-wizard-stage > section { display: grid; gap: 18px; }
.incident-wizard-stage > section[hidden] { display: none; }
.incident-wizard-step-copy { display: flex; align-items: flex-start; gap: 13px; }
.incident-wizard-step-copy > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: rgba(128, 103, 255, .11); color: #b3a7ff; font-size: .57rem; font-weight: 800; }
.incident-wizard-step-copy h3 { margin: 0; font-size: .86rem; }
.incident-wizard-step-copy p { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: .58rem; line-height: 1.6; }
.incident-location-trigger { width: 100%; min-height: 64px; border-color: rgba(128, 103, 255, .22); background: linear-gradient(120deg, rgba(128, 103, 255, .08), rgba(83, 224, 255, .025)); }
.incident-location-trigger:hover { border-color: rgba(143, 122, 255, .48); background: rgba(128, 103, 255, .1); }
.incident-wizard-plan { overflow: hidden; border: 1px solid rgba(128, 103, 255, .17); border-radius: 16px; background: #070c17; }
.incident-wizard-plan-tools { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px 9px 15px; border-bottom: 1px solid var(--line); background: rgba(13, 19, 34, .94); }
.incident-wizard-plan-tools > div { min-width: 0; display: grid; gap: 3px; }
.incident-wizard-plan-tools strong, .incident-wizard-plan-tools small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incident-wizard-plan-tools strong { font-size: .6rem; }
.incident-wizard-plan-tools small { color: var(--muted); font-size: .49rem; }
.incident-wizard-plan-empty { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; text-align: center; }
.incident-wizard-plan-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(128, 103, 255, .1); color: #a392ff; }
.incident-wizard-plan-empty svg { width: 23px; height: 23px; }
.incident-wizard-plan-empty h3 { margin: 4px 0 0; font-size: .72rem; }
.incident-wizard-plan-empty p { max-width: 440px; margin: 0; color: var(--muted); font-size: .55rem; line-height: 1.55; }
.incident-wizard-plan-host { min-height: 420px; outline: 0; }
.incident-wizard-plan-host .ps-header,
.incident-wizard-plan-host .ps-toolbar,
.incident-wizard-plan-host .ps-left-panel,
.incident-wizard-plan-host .ps-inspector,
.incident-wizard-plan-host .ps-statusbar { display: none !important; }
.incident-wizard-plan-host .ps-studio { min-height: 420px; border: 0; border-radius: 0; }
.incident-wizard-plan-host .ps-body { min-height: 420px; grid-template-columns: minmax(0, 1fr) !important; }
.incident-wizard-plan-host .ps-workspace, .incident-wizard-plan-host .ps-dropzone { min-height: 420px; }
.incident-wizard-plan-host .ps-canvas-hint { background: rgba(7, 12, 23, .84); backdrop-filter: blur(8px); }
.incident-media-drop {
  min-height: 238px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1px dashed rgba(128, 103, 255, .38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 5%, rgba(128, 103, 255, .16), transparent 15rem),
    rgba(9, 14, 27, .72);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.incident-media-drop:hover { transform: translateY(-1px); border-color: rgba(143, 122, 255, .68); background-color: rgba(128, 103, 255, .045); }
.incident-media-drop > span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg, rgba(139, 115, 255, .22), rgba(83, 224, 255, .08)); color: #b5a8ff; box-shadow: 0 16px 34px rgba(73, 50, 180, .18); }
.incident-media-drop svg { width: 27px; height: 27px; }
.incident-media-drop strong { color: #eef0f8; font-size: .76rem; }
.incident-media-drop small { font-size: .53rem; }
.incident-draft-attachments { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.incident-draft-attachment { min-width: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr) 30px; align-items: center; gap: 9px; padding: 8px; border: 1px solid rgba(128, 103, 255, .16); border-radius: 12px; background: rgba(128, 103, 255, .045); }
.incident-draft-attachment > img, .incident-draft-attachment > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 9px; background: #0b1120; object-fit: cover; color: #8e7bff; }
.incident-draft-attachment > div { min-width: 0; }
.incident-draft-attachment strong, .incident-draft-attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incident-draft-attachment strong { font-size: .55rem; }
.incident-draft-attachment small { margin-top: 3px; color: var(--muted); font-size: .47rem; }
.incident-draft-attachment button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.incident-draft-attachment button:hover { background: rgba(255, 97, 119, .09); color: #ff8494; }
.incident-draft-attachment button svg { width: 13px; height: 13px; }
.incident-wizard-details-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.incident-wizard-description { display: grid; gap: 12px; }
.incident-wizard-description textarea { min-height: 210px; resize: vertical; }
.incident-wizard-review { padding: 17px; border: 1px solid rgba(128, 103, 255, .18); border-radius: 16px; background: linear-gradient(145deg, rgba(128, 103, 255, .075), rgba(83, 224, 255, .025)); }
.incident-wizard-review h3 { margin: 7px 0 14px; color: #f0eff9; font-size: .74rem; line-height: 1.45; overflow-wrap: anywhere; }
.incident-wizard-review dl { display: grid; gap: 0; margin: 0; }
.incident-wizard-review dl > div { display: grid; grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr); gap: 10px; padding: 10px 0; border-top: 1px solid rgba(128, 103, 255, .11); }
.incident-wizard-review dt { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .5rem; }
.incident-wizard-review dt svg { width: 13px; height: 13px; }
.incident-wizard-review dd { margin: 0; color: #d9dce8; font-size: .54rem; line-height: 1.45; overflow-wrap: anywhere; text-align: right; }
.incident-wizard-actions { flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr auto; }

.maintenance-incident-modal { width: min(1120px, 100%); height: min(90dvh, 900px); max-height: min(90dvh, 900px); }
.maintenance-incident-head { flex: 0 0 auto; }
.maintenance-incident-head-actions { display: flex; align-items: center; gap: 8px; }
.maintenance-incident-body { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); overflow: hidden; }
.maintenance-incident-summary { min-height: 0; overflow-y: auto; padding: 20px; border-right: 1px solid var(--line); background: radial-gradient(circle at 20% 0, rgba(128, 103, 255, .1), transparent 22rem); }
.maintenance-incident-status { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.maintenance-incident-summary > p { margin: 17px 0; color: #e3e6ef; font-size: .67rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.maintenance-incident-summary dl { display: grid; gap: 0; margin: 0; }
.maintenance-incident-summary dl > div { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 10px 0; border-top: 1px solid rgba(128, 103, 255, .11); }
.maintenance-incident-summary dt { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .5rem; }
.maintenance-incident-summary dt svg { width: 13px; height: 13px; }
.maintenance-incident-summary dd { margin: 0; color: #e0e2eb; font-size: .54rem; line-height: 1.45; overflow-wrap: anywhere; text-align: right; }
.maintenance-incident-photos { margin-top: 18px; }
.maintenance-incident-photos h3 { margin: 0 0 9px; font-size: .65rem; }
.maintenance-incident-comments { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(6, 10, 19, .42); }
.maintenance-incident-comments > header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.maintenance-incident-comments > header h3 { margin: 4px 0 0; font-size: .72rem; }
.incident-comments-loading { width: 18px; height: 18px; border: 2px solid rgba(128, 103, 255, .18); border-top-color: #9c89ff; border-radius: 50%; animation: media-spin .8s linear infinite; }
.incident-detail-error { display: flex; align-items: center; gap: 10px; margin: 10px 14px 0; padding: 10px; border: 1px solid rgba(255, 97, 119, .22); border-radius: 11px; background: rgba(255, 97, 119, .055); }
.incident-detail-error > span { color: #ff8494; }
.incident-detail-error p { min-width: 0; flex: 1; margin: 0; color: #d9b6bd; font-size: .53rem; }
.incident-comment-list { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; padding: 15px; overscroll-behavior: contain; }
.incident-comment { width: min(88%, 680px); display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: end; gap: 8px; }
.incident-comment.is-mine { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 32px; }
.incident-comment.is-mine .chat-message-avatar { grid-column: 2; }
.incident-comment.is-mine > div { grid-column: 1; grid-row: 1; border-radius: 12px 4px 12px 12px; background: rgba(128, 103, 255, .13); }
.incident-comment > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px 12px 12px; background: rgba(255, 255, 255, .025); }
.incident-comment header { display: flex; justify-content: space-between; gap: 10px; }
.incident-comment header strong { font-size: .5rem; }
.incident-comment header time { color: var(--muted-2); font-size: .44rem; }
.incident-comment p { margin: 6px 0 0; color: #e3e6ef; font-size: .59rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.incident-comments-empty { margin: auto; display: grid; gap: 4px; padding: 28px; color: var(--muted); font-size: .58rem; text-align: center; }
.incident-comments-empty small { color: var(--muted-2); font-size: .49rem; }
.incident-comment-form { display: grid; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: rgba(7, 11, 21, .92); }
.incident-comment-form .incident-draft-attachments { max-height: 134px; overflow-y: auto; }
.incident-comment-compose { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: end; gap: 8px; }
.incident-comment-compose .icon-button { width: 38px; height: 40px; cursor: pointer; }
.incident-comment-compose textarea { min-height: 40px; max-height: 110px; resize: vertical; }
.incident-comment-compose .button { width: 42px; min-width: 42px; height: 40px; padding: 0; display: grid; place-items: center; }
.incident-comment-compose .button svg { width: 17px; height: 17px; }

@media (max-width: 960px) {
  .incident-wizard-modal, .maintenance-incident-modal { width: min(94vw, 920px); max-height: 94dvh; height: 94dvh; }
  .incident-wizard-stage { padding-inline: 18px; }
  .incident-wizard-details-grid { grid-template-columns: 1fr; }
  .incident-wizard-review { order: -1; }
  .incident-wizard-plan-host, .incident-wizard-plan-host .ps-studio, .incident-wizard-plan-host .ps-body, .incident-wizard-plan-host .ps-workspace, .incident-wizard-plan-host .ps-dropzone { min-height: 340px; }
  .maintenance-incident-body { grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); }
}
@media (max-width: 720px) {
  .chat-incident-feed { padding: 13px 11px; }
  .chat-incident-feed-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .chat-incident-feed-head p { max-width: none; text-align: left; }
  .chat-incident-card-main { grid-template-columns: 40px minmax(0, 1fr); padding: 12px 12px 12px 14px; }
  .chat-incident-card-icon { width: 40px; height: 40px; }
  .chat-incident-card-open { display: none; }
  .incident-wizard-modal, .maintenance-incident-modal { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .incident-wizard-progress { gap: 6px; padding-inline: 14px; }
  .incident-wizard-progress em { display: none; }
  .incident-wizard-progress b { width: 27px; height: 27px; }
  .incident-wizard-stage { padding: 15px 12px; }
  .incident-wizard-plan-tools { align-items: stretch; flex-direction: column; }
  .incident-wizard-plan-tools .button { width: 100%; }
  .incident-wizard-plan-host, .incident-wizard-plan-host .ps-studio, .incident-wizard-plan-host .ps-body, .incident-wizard-plan-host .ps-workspace, .incident-wizard-plan-host .ps-dropzone { min-height: 300px; }
  .incident-media-drop { min-height: 210px; }
  .incident-draft-attachments { grid-template-columns: 1fr; }
  .incident-wizard-actions { padding-inline: 12px; }
  .maintenance-incident-head .button span { display: none; }
  .maintenance-incident-body { display: block; overflow-y: auto; }
  .maintenance-incident-summary { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .maintenance-incident-comments { min-height: 540px; }
}

/* Canvas-first building plan workspace */
.view-host.route-map {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 14px 16px;
}
.route-map .plan-page {
  height: calc(100dvh - var(--topbar) - 28px);
  min-height: 720px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.plan-navigation {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(210px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(128, 103, 255, .18);
  border-radius: 15px;
  background:
    radial-gradient(circle at 78% -80%, rgba(83, 64, 190, .2), transparent 22rem),
    rgba(8, 12, 23, .94);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
}
.plan-navigation-location {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-navigation-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 103, 255, .22);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(76, 134, 255, .1), rgba(128, 103, 255, .15));
  color: var(--violet-bright);
}
.plan-navigation-icon svg { width: 20px; height: 20px; }
.plan-navigation-location .section-kicker { margin-bottom: 2px; font-size: .56rem; }
.plan-navigation-location h1 {
  margin: 0;
  overflow: hidden;
  font-size: .94rem;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-navigation-location p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-navigation-selects {
  display: flex;
  align-items: center;
  gap: 7px;
}
.plan-navigation-selects label {
  min-width: 150px;
  display: grid;
  gap: 3px;
  color: var(--muted-2);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.plan-navigation-selects select {
  width: 100%;
  height: 36px;
  padding: 0 31px 0 10px;
  border-color: rgba(151, 161, 196, .13);
  border-radius: 9px;
  background-color: rgba(16, 22, 38, .82);
  font-size: .66rem;
  text-transform: none;
  letter-spacing: 0;
}
.plan-navigation-status {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.plan-navigation-status > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.plan-navigation-status strong,
.plan-navigation-status small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-navigation-status strong { font-size: .64rem; }
.plan-navigation-status small { color: var(--muted-2); font-size: .55rem; }
.plan-navigation-status .status-dot.is-muted { background: var(--muted-2); box-shadow: none; }
.plan-navigation-actions { display: flex; align-items: center; gap: 6px; }
.plan-navigation-actions .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(16, 22, 38, .72);
}
.route-map .plan-studio-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 17px;
}
.plan-setup-empty {
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  place-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px;
  border: 1px dashed rgba(128, 103, 255, .24);
  border-radius: 17px;
  background: radial-gradient(circle at 50% 45%, rgba(91, 63, 205, .12), transparent 28rem), rgba(7, 11, 21, .76);
}
.plan-setup-empty > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(128, 103, 255, .11);
  color: var(--violet-bright);
}
.plan-setup-empty h2 { margin: 0; font-size: .88rem; }
.plan-setup-empty p { margin: 5px 0 0; color: var(--muted); font-size: .57rem; line-height: 1.5; }

@media (max-width: 1440px) {
  .plan-navigation { grid-template-columns: minmax(220px, 1fr) auto minmax(170px, auto) auto; }
  .plan-navigation-selects label { min-width: 132px; }
}

@media (max-width: 1100px) {
  .plan-navigation { grid-template-columns: minmax(220px, 1fr) auto auto; }
  .plan-navigation-status { display: none; }
}

@media (max-width: 820px) {
  .view-host.route-map { padding: 8px 8px calc(76px + env(safe-area-inset-bottom)); }
  .route-map .plan-page { height: auto; min-height: calc(100dvh - 78px); }
  .plan-navigation { grid-template-columns: minmax(0, 1fr) auto; }
  .plan-navigation-selects { grid-column: 1 / -1; }
  .plan-navigation-selects label { min-width: 0; flex: 1; }
  .route-map .plan-studio-shell { height: max(620px, calc(100dvh - 190px)); }
}

@media (max-width: 500px) {
  .plan-navigation { gap: 8px; padding: 8px; }
  .plan-navigation-icon { width: 36px; height: 36px; }
  .plan-navigation-location p { display: none; }
  .plan-navigation-actions { gap: 4px; }
  .plan-navigation-actions .icon-button { width: 34px; height: 34px; }
  .plan-setup-empty { grid-template-columns: 1fr; justify-items: start; }
  .plan-setup-empty .button { width: 100%; }
}

/* Immersive building-plan route */
.view-host.route-map {
  padding: 10px 12px 12px;
}

.route-map .plan-page {
  position: relative;
  height: calc(100dvh - var(--topbar) - 22px);
  min-height: 560px;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.route-map .plan-studio-shell {
  grid-column: 1;
  grid-row: 1;
  border-radius: 16px;
}

.plan-navigation {
  position: absolute;
  z-index: 42;
  top: 16px;
  left: 16px;
  width: min(390px, calc(100% - 32px));
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(7, 11, 22, .76);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px) saturate(130%);
  clip-path: inset(0 calc(100% - min(340px, 100%)) 0 0 round 14px);
  transition:
    clip-path 210ms cubic-bezier(.22, 1, .36, 1),
    opacity 160ms ease,
    transform 210ms cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear 210ms;
}

.plan-navigation[open] {
  clip-path: inset(0 0 0 0 round 14px);
  transition-delay: 0s;
}

.plan-navigation > summary {
  width: min(340px, 100%);
  list-style: none;
}

.plan-navigation > summary::-webkit-details-marker {
  display: none;
}

.plan-navigation-trigger {
  min-height: 54px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 8px 18px;
  align-items: center;
  gap: 10px;
  padding: 7px 11px 7px 8px;
  border-radius: inherit;
  color: var(--text);
  cursor: pointer;
}

.plan-navigation-trigger:hover {
  background: rgba(128, 103, 255, .075);
}

.plan-navigation-trigger:focus-visible {
  outline: 2px solid var(--violet-bright);
  outline-offset: 3px;
}

.plan-navigation-icon {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(128, 103, 255, .14);
}

.plan-navigation-location {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.plan-navigation-location strong,
.plan-navigation-location small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-navigation-location strong {
  color: #f4f5fb;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: -.015em;
}

.plan-navigation-location small {
  color: #a7b0c4;
  font-size: .75rem;
}

.plan-navigation-trigger > .status-dot {
  width: 8px;
  height: 8px;
}

.plan-navigation-trigger > .status-dot.is-muted {
  background: var(--muted-2);
  box-shadow: none;
}

.plan-navigation-chevron {
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1);
}

.plan-navigation-chevron svg {
  width: 15px;
  height: 15px;
}

.plan-navigation[open] .plan-navigation-chevron {
  transform: rotate(180deg);
}

.plan-navigation-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 4px 12px 12px;
  animation: plan-navigation-in 200ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes plan-navigation-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: none; }
}

.plan-navigation-selects {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.plan-navigation-selects label {
  min-width: 0;
  gap: 5px;
  color: #9ba5ba;
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.plan-navigation-selects select {
  height: 44px;
  padding: 0 34px 0 12px;
  border: 0;
  border-radius: 10px;
  background-color: rgba(22, 29, 48, .9);
  color: #f4f5fb;
  font-size: .8rem;
}

.plan-navigation-status {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 2px 0 2px 3px;
}

.plan-navigation-status strong {
  font-size: .75rem;
}

.plan-navigation-status small {
  color: #9ba5ba;
  font-size: .7rem;
}

.plan-navigation-actions {
  align-self: end;
  gap: 4px;
}

.plan-navigation-actions .icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: rgba(22, 29, 48, .82);
}

.plan-navigation-actions .icon-button:hover {
  background: rgba(128, 103, 255, .16);
}

.route-map .plan-setup-empty {
  grid-column: 1;
  grid-row: 1;
  border: 0;
  background:
    radial-gradient(ellipse at 55% 38%, rgba(128, 103, 255, .15), transparent 34%),
    linear-gradient(145deg, #070b17, #03050b);
}

.app-shell.map-route .page-identity p {
  display: none;
}

.app-shell.map-route .page-identity h1 {
  margin: 0;
  font-size: 1rem;
}

html.map-route-active,
body.map-route-active {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 820px) {
  .view-host.route-map {
    padding: 0 0 calc(68px + env(safe-area-inset-bottom));
  }

  .route-map .plan-page {
    height: calc(100dvh - var(--topbar) - 68px - env(safe-area-inset-bottom));
    min-height: 520px;
  }

  .route-map .plan-studio-shell {
    height: 100%;
    min-height: 0;
    border-radius: 0;
  }

  .plan-navigation {
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    clip-path: inset(0 calc(100% - min(300px, calc(100vw - 128px))) 0 0 round 14px);
  }

  .plan-navigation[open] {
    clip-path: inset(0 0 0 0 round 14px);
  }

  .plan-navigation > summary {
    width: min(300px, calc(100vw - 128px));
  }

  .plan-navigation-trigger {
    min-height: 52px;
  }

  .plan-navigation-location strong {
    font-size: .88rem;
  }

  .plan-navigation-location small,
  .plan-navigation-status strong,
  .plan-navigation-status small,
  .plan-navigation-selects label {
    font-size: .75rem;
  }

  .plan-navigation-selects select {
    font-size: 16px;
  }

  .plan-navigation-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 500px) {
  .plan-navigation {
    clip-path: inset(0 calc(100% - 100vw + 122px) 0 0 round 14px);
  }

  .plan-navigation > summary {
    width: calc(100vw - 122px);
  }

  .plan-navigation-trigger {
    grid-template-columns: 36px minmax(0, 1fr) 8px 16px;
    gap: 8px;
    padding-inline: 7px 9px;
  }

  .plan-navigation-icon {
    width: 36px;
    height: 36px;
  }

  .plan-navigation-panel {
    grid-template-columns: 1fr;
  }

  .plan-navigation-selects {
    grid-template-columns: 1fr;
  }

  .plan-navigation-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  .route-map .plan-page {
    min-height: 0;
  }

  .route-map .plan-studio-shell,
  .ps-host.ps-canvas-first .ps-studio {
    min-height: 0;
  }

  .route-map .plan-page:has(.ps-studio.is-toolbar-options-open) .plan-navigation {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, -8px, 0);
  }
}

@media (max-width: 820px) {
  .route-map .plan-page:has(.ps-studio.is-room-card-expanded) .plan-navigation {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, -8px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .plan-navigation,
  .plan-navigation-panel,
  .plan-navigation-chevron {
    animation: none !important;
    transition: none !important;
  }

  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { padding: 0; color: #111; background: white; }
  .sidebar, .topbar, .mobile-nav, .drawer, .popover, .toast, .filter-bar, .section-heading .button { display: none !important; }
  .workspace { margin: 0; }
  .view-host { max-width: none; padding: 0; }
  .asset-day-heading { position: static; border-color: #ccc; background: white; box-shadow: none; }
  .asset-day-heading h2, .asset-day-heading > strong { color: #111; }
  .panel, .dashboard-panel, .data-table-wrap, .entity-card, .employee-card, .report-card, .incident-card { break-inside: avoid; border-color: #ccc; box-shadow: none; background: white; color: #111; }
  .data-table th, .data-table td { color: #222; border-color: #ddd; background: white; }
}
