:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #181818;
  --surface-2: #232323;
  --control: #0d100f;
  --text: #ffffff;
  --muted: #a6a6a6;
  --line: #333333;
  --line-soft: #242424;
  --accent: #bdf553;
  --accent-hover: #d3ff7a;
  --accent-contrast: #111815;
  --danger: #f87171;
  --danger-text: #ffb8b8;
  --warning: #fbbf24;
  --idle: #fbbf24;
  --locked: #94a3b8;
  --overlay: rgba(0, 0, 0, 0.76);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 28px;
  --font-sans: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --text-body: 0.95rem;
  --text-caption: 0.82rem;
  --text-eyebrow: 0.72rem;
  --weight-label: 600;
  --weight-strong: 700;
  --weight-display: 800;
  --control-height: 42px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #edf2ef;
  --control: #ffffff;
  --text: #111815;
  --muted: #5b6b63;
  --line: #c5d1ca;
  --line-soft: #dde6e1;
  --accent: #8ecb24;
  --accent-hover: #78b414;
  --accent-contrast: #111815;
  --danger: #dc2626;
  --danger-text: #8f1d1d;
  --warning: #d97706;
  --overlay: rgba(20, 31, 25, 0.42);
  --shadow: 0 20px 60px rgba(18, 35, 27, 0.13);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted-text { color: var(--muted); }

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-brand { display: grid; gap: 14px; margin-bottom: 22px; }
.auth-brand h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  font-weight: var(--weight-display);
  letter-spacing: -0.04em;
}
.auth-brand p { margin: 4px 0 0; color: var(--muted); }
.auth-form { display: grid; gap: 8px; }
.auth-form h2 { margin: 0 0 4px; font-size: 1.15rem; }
.auth-form label { color: var(--muted); font-size: var(--text-caption); font-weight: var(--weight-label); }
.auth-form input,
.date-field input {
  min-height: var(--control-height);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.auth-form button,
button.cta-primary,
a.cta-primary,
.cta-primary {
  min-height: var(--control-height);
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: var(--weight-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  text-decoration: none;
  font-weight: var(--weight-label);
  cursor: pointer;
}
.auth-message { margin: 12px 0 0; color: var(--danger-text); font-weight: var(--weight-strong); }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  max-height: 100vh;
  padding: 18px 14px 16px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  overflow: hidden;
}
.sidebar-top {
  display: grid;
  gap: 14px;
  flex: 0 0 auto;
  padding: 2px 4px 0;
}
.sidebar-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: start;
  gap: 8px;
}
.sidebar-mark-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.sidebar-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.brand-block {
  display: grid;
  gap: 6px;
  min-width: 0;
  grid-column: 1;
  text-decoration: none;
  color: inherit;
}
.brand-product {
  display: block;
  margin: 0;
  padding-left: 2px;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: var(--weight-strong);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1;
}
.sidebar-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  grid-column: 2;
  grid-row: 1;
}
.sidebar-toggle-icon {
  display: block;
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}
.sidebar-toggle:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}
@media (min-width: 981px) {
  .sidebar-toggle { display: inline-flex; }
}
.dept-switcher {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 4%, var(--surface-2));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.dept-switcher:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--surface-2));
}
.dept-switcher-icon,
.dept-switcher-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.dept-switcher-icon svg,
.dept-switcher-chevron svg {
  width: 16px;
  height: 16px;
  display: block;
}
.dept-switcher-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--weight-label);
  font-size: 0.92rem;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}
.nav,
.panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.view-list {
  display: grid;
  gap: 14px;
}
.view-group {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.view-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.view-group-title {
  margin: 0 10px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.view-button {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-weight: var(--weight-label);
  cursor: pointer;
}
.view-button-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.view-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: inherit;
}
.view-button-icon svg { display: block; width: 18px; height: 18px; }
.view-button-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.view-button-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}
.view-button-chevron svg { width: 14px; height: 14px; display: block; }
.view-button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.view-button.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.view-button.active:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.view-button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.view-button.active .view-button-chevron { color: var(--accent); }
.revit-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #1f6feb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.view-button.active .revit-mark {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
  padding: 4px 2px 0;
  justify-items: stretch;
}
.account-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.account-button:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--text) 7%, var(--surface));
}
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 5%, var(--surface-2));
  color: var(--text);
  font-weight: var(--weight-label);
  cursor: pointer;
}
.logout-button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 9%, var(--surface-2));
}
.logout-icon {
  display: inline-flex;
  color: var(--muted);
}
.logout-icon svg { width: 18px; height: 18px; display: block; }
.account-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background-color: #111815;
  background-position: center;
  background-size: cover;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fff;
}
.account-avatar.has-photo { color: transparent; }
.account-text {
  display: grid;
  min-width: 0;
  gap: 1px;
  flex: 1 1 auto;
}
.account-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.account-role { color: var(--muted); font-size: 12px; }
.account-gear {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin-left: auto;
  place-items: center;
  color: var(--muted);
}
.account-gear svg { width: 16px; height: 16px; display: block; }
.storage-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.storage-stat-value {
  font-size: 1.8rem;
  font-weight: var(--weight-display);
  color: var(--accent);
  letter-spacing: -0.04em;
}
.storage-stat-label {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-label);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 28px 36px 40px;
}
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
  padding: 0 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar h2 {
  margin: 6px 0 0;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  font-weight: var(--weight-display);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.view-subtitle { margin: 8px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.date-field { display: grid; gap: 4px; font-size: var(--text-caption); color: var(--muted); }
.date-field[hidden],
.seg-tabs[hidden],
#exportDashboard[hidden],
#addEmployeeBtn[hidden] { display: none !important; }
.content { display: grid; gap: 28px; }

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px 28px;
}
.metric {
  min-height: 0;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.metric span {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-label);
}
.metric strong { font-size: 28px; line-height: 1.05; letter-spacing: -0.04em; }

.card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.card h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: var(--weight-label);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.table td { padding: 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: inherit; text-decoration: none; font-weight: var(--weight-label); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.timeline { display: grid; }
.tl-row {
  display: grid;
  grid-template-columns: 72px 16px 28px 1fr;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  align-items: start;
}
.tl-row time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.tl-rail { position: relative; }
.tl-rail::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: -10px;
  width: 1px;
  background: var(--line-soft);
}
.tl-row:last-child .tl-rail::before { display: none; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); margin-top: 4px; }
.dot.idle { background: var(--idle); }
.dot.locked { background: var(--locked); }
.tl-body { padding-bottom: 18px; }
.tl-body strong { display: block; }
.tl-body span { color: var(--muted); font-size: 13px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.shot {
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.shot img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--surface-2); }
.shot figcaption { padding: 12px 14px 14px; }
.shot small { color: var(--muted); }

/* —— Screenshots page —— */
.shots-page {
  display: grid;
  gap: 14px;
}
.shots-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
}
.shots-search { flex: 1 1 220px; min-width: 180px; }
.shots-select {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--control);
  color: var(--text);
  font: inherit;
}
.shots-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.shots-view-toggle button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.shots-view-toggle button.is-active {
  background: var(--accent);
  color: #111;
  font-weight: 700;
}
.shots-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.shots-zoom input[type="range"] {
  width: 100px;
  accent-color: var(--accent);
}
.shot-kpi-apps {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.shot-kpi-apps .app-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.shot-kpi-apps .app-logo svg { width: 14px; height: 14px; }

.shots-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.shots-layout.is-empty { grid-template-columns: 1fr; }
.shots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--shot-size, 220px), 1fr));
  gap: 14px;
}
.shots-gallery[data-view="list"] {
  grid-template-columns: 1fr;
}
.shots-gallery[data-view="list"] .shot-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: stretch;
}
.shots-gallery[data-view="list"] .shot-card-media {
  aspect-ratio: 16 / 10;
  min-height: 96px;
}
.shots-gallery[data-view="list"] .shot-card-meta {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}
.shots-empty { grid-column: 1 / -1; margin: 24px 0; }

.shot-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shot-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-soft)); }
.shot-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.shot-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.shot-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shot-card-check {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.shot-card.is-selected .shot-card-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #111;
}
.shot-card-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.shot-card:hover .shot-card-expand,
.shot-card.is-selected .shot-card-expand { opacity: 1; }
.shot-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}
.shot-card-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.shot-card-app .app-logo {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.shot-card-app .app-logo svg { width: 14px; height: 14px; }
.shot-card-app strong {
  font-size: 13px;
  font-weight: var(--weight-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-card-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.shots-detail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  align-content: start;
}
.shot-detail-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.shot-detail-head .app-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.shot-detail-head .app-logo svg { width: 20px; height: 20px; }
.shot-detail-head strong {
  display: block;
  font-size: 15px;
}
.shot-detail-head span {
  color: var(--muted);
  font-size: 12px;
}
.shot-detail-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--weight-label);
  white-space: nowrap;
}
.shot-detail-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.shot-detail-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.shot-detail-preview small {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}
.shot-detail-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
}
.shot-detail-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: var(--weight-label);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.shot-detail-info {
  margin: 0;
  display: grid;
  gap: 10px;
}
.shot-detail-info div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: baseline;
}
.shot-detail-info dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.shot-detail-info dd {
  margin: 0;
  font-size: 13px;
  word-break: break-word;
}
.shot-detail-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.shot-detail-actions .cta-primary {
  width: 100%;
  justify-content: center;
}
.shot-icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.shot-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shot-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list li::before { content: "✓  "; color: var(--accent); font-weight: 800; }
.list.never li::before { content: "×  "; color: var(--danger); }

/* —— Settings / Privacy / Help —— */
.settings-page,
.info-page {
  display: grid;
  gap: 16px;
  max-width: 960px;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.settings-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-label);
  cursor: pointer;
}
.settings-tabs button.is-active {
  background: var(--accent);
  color: #111;
}
.settings-body { display: grid; gap: 14px; }
.settings-card {
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
}
.settings-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.settings-card-head h3 { margin: 0 0 4px; font-size: 16px; }
.settings-card-head p { margin: 0; }
.settings-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  flex: 0 0 auto;
}
.settings-card-icon svg { width: 20px; height: 20px; }
.settings-status-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.settings-status-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.settings-status-title h3 { margin: 0; }
.settings-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-label);
}
.settings-badge.is-on {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.settings-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line-soft));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.settings-lists { margin: 0; }
.settings-list-card {
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
}
.settings-list-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
}
.settings-org-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.settings-org-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-label);
}
.settings-org-form input {
  min-height: var(--control-height);
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.settings-org-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--text); }
.settings-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.settings-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
}
.settings-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.help-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.help-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.help-link:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-soft));
}
.help-link svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: 0 0 auto;
}

/* —— Audit / Journal —— */
.audit-page { display: grid; gap: 14px; }
.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.audit-layout.is-empty { grid-template-columns: 1fr; }
.audit-main { padding: 0; overflow: hidden; }
.audit-toolbar .secondary { white-space: nowrap; }
.audit-table { min-width: 860px; }
.audit-table th,
.audit-table td { padding: 12px 14px; vertical-align: middle; }
.audit-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
  border-left: 3px solid transparent;
}
.audit-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.audit-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left-color: var(--accent);
}
.audit-when { white-space: nowrap; color: var(--muted); font-size: 13px; }
.audit-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.audit-action strong { font-size: 13px; font-weight: var(--weight-label); }
.audit-action-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  flex: 0 0 auto;
}
.audit-action-icon svg { width: 14px; height: 14px; }
.audit-action-shot .audit-action-icon,
.audit-action-icon.audit-action-shot {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.audit-action-settings .audit-action-icon,
.audit-action-icon.audit-action-settings {
  background: color-mix(in srgb, #60a5fa 22%, transparent);
  color: #60a5fa;
}
.audit-action-tracking .audit-action-icon,
.audit-action-icon.audit-action-tracking {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.audit-action-admin .audit-action-icon,
.audit-action-icon.audit-action-admin {
  background: color-mix(in srgb, #a78bfa 20%, transparent);
  color: #a78bfa;
}
.audit-action-login .audit-action-icon,
.audit-action-icon.audit-action-login {
  background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent);
  color: var(--danger, #ef4444);
}
.audit-object {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}
.audit-detail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  align-content: start;
}
.audit-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.audit-detail-head h3 { margin: 0; font-size: 15px; }
.audit-detail-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.audit-detail-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.audit-detail-summary strong { display: block; font-size: 15px; }
.audit-detail-summary span { color: var(--muted); font-size: 12px; }
.audit-detail-info {
  margin: 0;
  display: grid;
  gap: 12px;
}
.audit-detail-info > div { display: grid; gap: 6px; }
.audit-detail-info dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audit-detail-info dd { margin: 0; font-size: 13px; }
.audit-object-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.audit-object-row code { flex: 1; min-width: 0; }
.audit-object-row .shot-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  cursor: pointer;
}
.audit-details-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  max-height: 160px;
  overflow: auto;
}

/* —— Revit page —— */
.revit-page { display: grid; gap: 14px; }
.revit-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.revit-tab-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}
.revit-tab-icon svg { width: 14px; height: 14px; }
.revit-mid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 12px;
}
.revit-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}
.revit-chrono { padding: 0; overflow: hidden; }
.revit-chrono .panel-head { padding: 16px 16px 0; }
.revit-hour-chart .revit-hour-bar {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
  background: var(--surface-2);
}
.revit-seg { display: block; width: 100%; }
.revit-seg-created { background: var(--accent); }
.revit-seg-modified { background: #60a5fa; }
.revit-seg-deleted { background: var(--danger, #ef4444); }
.revit-seg-sync { background: #a78bfa; }
.revit-legend { margin-top: 10px; }
.revit-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.revit-dot-created { background: var(--accent); }
.revit-dot-modified { background: #60a5fa; }
.revit-dot-deleted { background: var(--danger, #ef4444); }
.revit-dot-sync { background: #a78bfa; }
.revit-top-users {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.revit-top-users li {
  display: grid;
  grid-template-columns: 20px 36px 1fr;
  gap: 10px;
  align-items: center;
}
.revit-top-rank {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.revit-top-body { display: grid; gap: 6px; min-width: 0; }
.revit-top-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.revit-top-row span { color: var(--muted); }
.revit-table { min-width: 900px; }
.revit-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--weight-label);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.revit-type-created { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.revit-type-modified { background: color-mix(in srgb, #60a5fa 18%, transparent); color: #60a5fa; }
.revit-type-deleted { background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent); color: var(--danger, #ef4444); }
.revit-type-sync { background: color-mix(in srgb, #a78bfa 18%, transparent); color: #a78bfa; }
.revit-type-view { background: color-mix(in srgb, #c084fc 16%, transparent); color: #c084fc; }
.revit-type-project { background: color-mix(in srgb, #38bdf8 16%, transparent); color: #38bdf8; }
.revit-action-created .audit-action-icon {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}
.revit-action-modified .audit-action-icon {
  background: color-mix(in srgb, #60a5fa 20%, transparent);
  color: #60a5fa;
}
.revit-action-deleted .audit-action-icon {
  background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent);
  color: var(--danger, #ef4444);
}
.revit-action-sync .audit-action-icon {
  background: color-mix(in srgb, #a78bfa 20%, transparent);
  color: #a78bfa;
}
.revit-filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.revit-filter-block { display: grid; gap: 8px; }
.revit-filter-block h4 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.revit-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.revit-check input { accent-color: var(--accent); }
.form-stack { display: grid; gap: 12px; margin-top: 16px; max-width: 360px; }
.form-stack label { display: grid; gap: 6px; color: var(--muted); font-size: var(--text-caption); font-weight: var(--weight-label); }
.form-stack input {
  min-height: var(--control-height);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.modal-card pre {
  white-space: pre-wrap;
  font: inherit;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px;
  border-radius: 12px;
}
.modal-card h3 { margin: 0 0 8px; }
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.switch {
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: #3a4440;
  position: relative;
  cursor: pointer;
}
.switch.is-on { background: var(--accent); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
}
.switch.is-on::after { left: 21px; }
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
}
.badge.off { color: var(--danger-text); }

.empty { margin: 0; padding: 28px 8px; color: var(--muted); text-align: center; }
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(880px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
}
.modal-card img { width: 100%; border-radius: 12px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.theme-toggle-track {
  position: relative;
  display: block;
  width: 56px;
  height: 28px;
  flex: 0 0 56px;
  border-radius: 999px;
  background: #1c2120;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.22),
    0 1px 3px rgba(0, 0, 0, 0.14);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}
.theme-toggle:hover .theme-toggle-track {
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.28),
    0 2px 4px rgba(0, 0, 0, 0.16);
}
.theme-toggle-sun,
.theme-toggle-moon {
  position: absolute;
  top: 50%;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  color: #f4f6f5;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 180ms ease, color 180ms ease;
}
.theme-toggle-moon { left: 8px; opacity: 0; }
.theme-toggle-sun { right: 8px; opacity: 1; }
.theme-toggle-sun svg,
.theme-toggle-moon svg {
  width: 12px;
  height: 12px;
  display: block;
}
.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 3px 7px rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme="light"] .theme-toggle-track { background: #dce6e0; }
:root[data-theme="light"] .theme-toggle-moon { opacity: 1; color: #111; }
:root[data-theme="light"] .theme-toggle-sun { opacity: 0; }
:root[data-theme="light"] .theme-toggle-knob { transform: translateX(28px); }
.theme-toggle--auth { position: absolute; top: 18px; right: 18px; }
.theme-toggle--sidebar {
  justify-content: flex-start;
  justify-self: start;
  width: auto;
  min-width: 0;
  padding: 0;
}

.report-switch { display: flex; gap: 4px; }
.report-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: var(--weight-label);
}
.report-tab:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.report-tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
}
.spark {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 150px;
  padding-top: 8px;
}
.spark-col {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.spark-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 8px 8px 4px 4px;
  background: var(--accent);
}
.mix-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 4px 0 12px;
}
.share { display: grid; gap: 12px; margin-top: 12px; }
.share-row { display: grid; gap: 4px; }
.share-row span { color: var(--muted); font-size: var(--text-caption); }

/* —— Dashboard (Сводка) —— */
.seg-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
}
.seg-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: var(--weight-label);
  cursor: pointer;
}
.seg-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.search-input {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--control);
  min-width: 160px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.kpi-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  min-height: 118px;
}
.kpi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--weight-label);
}
.kpi-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.kpi-hint, .kpi-trend {
  font-size: 12px;
  color: var(--muted);
}
.kpi-hint .shot-kpi-apps { margin-top: 2px; }
.trend-up { color: var(--accent); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--muted); }

.dash-mid,
.dash-bottom {
  display: grid;
  gap: 12px;
}
.dash-mid { grid-template-columns: 1.4fr 0.9fr 1fr; }
.dash-bottom { grid-template-columns: 1.5fr 0.9fr 1.1fr; }
.panel {
  padding: 16px 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  min-width: 0;
}
.panel-wide { grid-column: auto; }
.panel-head { margin-bottom: 14px; }
.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
}
.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.hour-chart { display: grid; gap: 12px; }
.hour-chart-plot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 180px;
  padding: 8px 4px 0;
  border-bottom: 1px solid var(--line-soft);
}
.hour-col {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}
.hour-bar {
  width: 100%;
  max-width: 28px;
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--surface-2);
}
.hour-bar > span { width: 100%; display: block; min-height: 0; }
.seg-active { background: var(--accent); }
.seg-idle { background: #6b7280; }
.seg-offline { background: #ef4444; }
.hour-label { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.chart-legend i,
.donut-legend i,
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-active { background: var(--accent); }
.dot-idle { background: #6b7280; }
.dot-offline, .status-dot.is-off { background: #ef4444; }
.status-dot.is-on { background: var(--accent); }

.donut-wrap { display: grid; gap: 16px; justify-items: center; }
.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.donut-hole {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}
.donut-hole strong { font-size: 1rem; letter-spacing: -0.03em; }
.donut-hole span { color: var(--muted); font-size: 12px; }
.donut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.donut-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.donut-legend strong { color: var(--text); margin-left: auto; }
.donut-legend span { color: var(--muted); min-width: 72px; text-align: right; }

.top-apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.top-apps li { display: grid; grid-template-columns: 18px 28px 1fr; gap: 10px; align-items: center; }
.top-apps-rank { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.app-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.app-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--app-bg, var(--surface-2));
  color: var(--app-fg, var(--accent));
  flex: 0 0 auto;
  overflow: hidden;
}
.app-logo svg { width: 18px; height: 18px; display: block; }
.app-logo-letter {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.activity-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  align-items: start;
}
.activity-side { display: grid; gap: 12px; min-width: 0; }
.activity-chrono-panel { min-height: 420px; }

.chrono { display: grid; }
.chrono-row {
  display: grid;
  grid-template-columns: 56px 16px 28px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 4px 0 14px;
}
.chrono-row time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding-top: 6px;
}
.chrono-rail { position: relative; }
.chrono-rail::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: -14px;
  width: 1px;
  border-left: 1px dashed var(--line-soft);
}
.chrono-row:last-child .chrono-rail::before { display: none; }
.chrono-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.chrono-dot.kind-idle { background: #6b7280; box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.25); }
.chrono-dot.kind-system { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25); }
.chrono-body { min-width: 0; padding-top: 2px; }
.chrono-body strong { display: block; font-size: 14px; }
.chrono-body span { color: var(--muted); font-size: 12px; }
.chrono-dur {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  padding-top: 4px;
}

.share-stack { display: grid; gap: 12px; }
.share-bar {
  display: flex;
  height: 14px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
}
.share-bar > span { display: block; height: 100%; min-width: 0; }
.seg-lock { background: #3f4550; }
.dot-lock { background: #3f4550; }

.activity-apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.activity-apps li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
}
.activity-apps-body { min-width: 0; display: grid; gap: 6px; }
.activity-apps-body .bar { margin-top: 0; }
.activity-apps-share {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.event-cell { display: inline-flex; align-items: center; gap: 8px; }
.event-kind {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  background: var(--accent);
  flex: 0 0 auto;
}
.event-kind-idle { background: #6b7280; border-radius: 50%; }
.event-kind-lock { background: #9ca3af; }
.event-kind-app { background: var(--accent); transform: rotate(45deg); }
.event-kind-other { background: #60a5fa; border-radius: 50%; }

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.page-size select {
  appearance: none;
  background: var(--control);
  color: var(--text);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font: inherit;
  font-size: 12px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}
.pager-nav { display: inline-flex; align-items: center; gap: 8px; }
.pager-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--control);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.pager-page { font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.top-apps-body { min-width: 0; display: grid; gap: 6px; }
.top-apps-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.top-apps-row span { color: var(--muted); white-space: nowrap; }

.app-cell { display: flex; align-items: center; gap: 10px; }
.apps-bar-cell { min-width: 80px; }
.apps-table td { vertical-align: middle; }

.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.people-list li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.people-avatar { width: 36px; height: 36px; font-size: 12px; }
.people-body { display: grid; gap: 6px; min-width: 0; }
.people-row { display: flex; justify-content: space-between; gap: 8px; }
.people-row span { color: var(--muted); font-size: 12px; }
.people-status { color: var(--muted); font-size: 12px; }

.events-table { font-size: 13px; }
.events-table td { white-space: nowrap; }
.events-table td:nth-child(2) { white-space: normal; }

.dash-archive { display: grid; gap: 12px; }
.panel-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.archive-table td { vertical-align: middle; }
.archive-table strong { font-weight: var(--weight-strong); }

/* —— Employees page —— */
.employees-page { display: grid; gap: 14px; }
.kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.emp-kpi-bar {
  display: inline-block;
  width: 72px;
  height: 6px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  vertical-align: middle;
  overflow: hidden;
}
.emp-kpi-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.emp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.emp-layout.is-empty { grid-template-columns: 1fr; }
.emp-main { padding: 0; overflow: hidden; }
.emp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.emp-search { flex: 1 1 200px; min-width: 160px; }
.emp-table-wrap { overflow-x: auto; }
.emp-table { min-width: 920px; }
.emp-table th,
.emp-table td { padding: 12px 14px; vertical-align: middle; }
.emp-table th:first-child,
.emp-table td:first-child { padding-left: 16px; }
.emp-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
.emp-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.emp-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.emp-check { width: 36px; }
.emp-check .shot-card-check {
  position: static;
  display: inline-block;
  vertical-align: middle;
}
.emp-check .shot-card-check.is-on,
.emp-row.is-selected .shot-card-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #111;
}
.emp-person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.emp-avatar { width: 36px; height: 36px; font-size: 12px; flex: 0 0 auto; }
.emp-person strong { display: block; font-size: 13px; }
.emp-person small { color: var(--muted); font-size: 12px; }
.emp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.emp-status strong { display: block; font-size: 13px; font-weight: var(--weight-label); }
.emp-status small { color: var(--muted); font-size: 12px; }
.emp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}
.emp-status-on .emp-status-dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.emp-status-away .emp-status-dot { background: #eab308; }
.emp-status-off .emp-status-dot { background: var(--danger, #ef4444); }
.emp-activity { display: grid; gap: 6px; min-width: 120px; }
.emp-activity strong { font-size: 13px; }
.emp-bar { height: 6px; }
.emp-apps { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.emp-apps .app-logo { width: 22px; height: 22px; border-radius: 6px; }
.emp-apps .app-logo svg { width: 14px; height: 14px; }
.emp-apps-more {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
}
.emp-device strong,
.emp-last strong { display: block; font-size: 13px; }
.emp-device small,
.emp-last small { color: var(--muted); font-size: 12px; }
.emp-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
}
.emp-foot-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.emp-foot .pager { border: 0; padding: 0; background: transparent; }

.emp-detail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  padding: 16px;
  align-content: start;
}
.emp-detail-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}
.emp-detail-avatar { width: 48px; height: 48px; font-size: 16px; }
.emp-detail-head strong { display: block; font-size: 16px; }
.emp-detail-head span { display: block; color: var(--muted); font-size: 12px; }
.emp-detail-presence { margin-top: 4px !important; font-size: 12px !important; }
.emp-detail-presence.emp-status-on { color: var(--accent) !important; }
.emp-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.emp-detail-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.emp-detail-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.emp-detail-body { display: grid; gap: 14px; }
.emp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.emp-metric {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.emp-metric span { color: var(--muted); font-size: 12px; }
.emp-metric strong { font-size: 16px; }
.emp-events-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.emp-events-row div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
}
.emp-events-row span { color: var(--muted); font-size: 11px; }
.emp-events-row strong { font-size: 13px; }
.emp-detail-block h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: var(--weight-label);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.emp-top-apps,
.emp-device-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.emp-top-apps li { display: grid; gap: 4px; }
.emp-top-app-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.emp-top-app-name .app-logo { width: 20px; height: 20px; }
.emp-top-app-name .app-logo svg { width: 12px; height: 12px; }
.emp-top-app-time { color: var(--muted); font-size: 12px; justify-self: end; }
.emp-top-apps li {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.emp-top-apps .bar { grid-column: 1 / -1; height: 5px; }
.emp-device-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.emp-device-list strong { display: block; font-size: 13px; }
.emp-device-list small { color: var(--muted); font-size: 12px; }
.emp-device-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.emp-device-badge.is-on {
  color: #111;
  background: var(--accent);
  font-weight: var(--weight-label);
}
.emp-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.emp-detail-actions .secondary,
.emp-detail-actions .cta-primary {
  width: 100%;
  justify-content: center;
  text-align: center;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-mid, .dash-bottom, .activity-layout { grid-template-columns: 1fr; }
  .shots-layout { grid-template-columns: 1fr; }
  .shots-detail { position: static; }
  .emp-layout { grid-template-columns: 1fr; }
  .emp-detail { position: static; }
  .audit-layout { grid-template-columns: 1fr; }
  .audit-detail { position: static; }
  .revit-mid,
  .revit-bottom { grid-template-columns: 1fr; }
  .revit-filters { position: static; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    min-height: 0;
    max-height: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .sidebar-nav { max-height: 42vh; }
  .main { padding: 20px 16px 32px; }
  .dashboard, .split, .privacy { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { min-height: 0; flex-direction: column; align-items: stretch; }
  .shots-zoom { margin-left: 0; width: 100%; }
  .shots-zoom input[type="range"] { flex: 1; width: auto; }
  .emp-detail-actions { grid-template-columns: 1fr; }
  .emp-events-row { grid-template-columns: 1fr; }
  .settings-org-form { grid-template-columns: 1fr; }
  .settings-status-row { flex-direction: column; align-items: stretch; }
}

@media (min-width: 981px) {
  html[data-sidebar="collapsed"] .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  html[data-sidebar="collapsed"] .sidebar {
    width: 76px;
    padding: 16px 8px;
    gap: 8px;
    align-items: center;
  }
  html[data-sidebar="collapsed"] .sidebar-top {
    width: 100%;
    padding: 0;
    gap: 10px;
    justify-items: center;
  }
  html[data-sidebar="collapsed"] .sidebar-brand-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  html[data-sidebar="collapsed"] .brand-block,
  html[data-sidebar="collapsed"] .brand-product,
  html[data-sidebar="collapsed"] .account-text,
  html[data-sidebar="collapsed"] .account-gear,
  html[data-sidebar="collapsed"] .logout-label,
  html[data-sidebar="collapsed"] .view-button-label,
  html[data-sidebar="collapsed"] .view-button-chevron,
  html[data-sidebar="collapsed"] .dept-switcher-label,
  html[data-sidebar="collapsed"] .dept-switcher-chevron {
    display: none;
  }
  html[data-sidebar="collapsed"] .sidebar-mark-link {
    display: flex;
  }
  html[data-sidebar="collapsed"] .sidebar-toggle-icon {
    transform: scaleX(-1);
  }
  html[data-sidebar="collapsed"] .dept-switcher {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
  }
  html[data-sidebar="collapsed"] .dept-switcher-icon {
    color: var(--text);
  }
  html[data-sidebar="collapsed"] .sidebar-nav {
    width: 100%;
  }
  html[data-sidebar="collapsed"] .view-list {
    justify-items: center;
    gap: 10px;
  }
  html[data-sidebar="collapsed"] .view-group {
    width: 100%;
    justify-items: center;
    padding-bottom: 8px;
    border-bottom: 0;
    gap: 4px;
  }
  html[data-sidebar="collapsed"] .view-group-title {
    display: block;
    width: 28px;
    height: 0;
    margin: 8px auto 4px;
    padding: 0;
    overflow: hidden;
    border-top: 1px solid var(--line-soft);
    font-size: 0;
    color: transparent;
  }
  html[data-sidebar="collapsed"] .view-group:first-child .view-group-title {
    display: none;
  }
  html[data-sidebar="collapsed"] .view-button {
    justify-content: center;
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    margin: 0 auto;
  }
  html[data-sidebar="collapsed"] .view-button-main {
    justify-content: center;
    flex: 0 0 auto;
    gap: 0;
  }
  html[data-sidebar="collapsed"] .view-button.active::before {
    top: 8px;
    bottom: 8px;
  }
  html[data-sidebar="collapsed"] .sidebar-footer {
    width: 100%;
    justify-items: center;
  }
  html[data-sidebar="collapsed"] .theme-toggle--sidebar {
    justify-self: start;
    margin-right: auto;
  }
  html[data-sidebar="collapsed"] .account-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
  }
  html[data-sidebar="collapsed"] .account-avatar {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 10px;
  }
  html[data-sidebar="collapsed"] .logout-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
  }
}

