:root {
  --bg: #f5f7f8;
  --text: #202428;
  --muted: #63707c;
  --line: #d9e0e4;
  --panel: #ffffff;
  --primary: #0c2a61;
  --primary-dark: #071a3d;
  --ok: #19784c;
  --warn: #b7791f;
  --danger: #b42318;
  --accent: #e21b2d;
  --shadow: 0 10px 28px rgba(25, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(104deg, #fff 0%, #fff 43%, #edf3fa 43.2%, #f4f7fb 100%);
}

.login-story {
  position: relative;
  display: grid;
  align-content: start;
  gap: 72px;
  padding: 52px 48px 40px;
}

.login-story > img {
  width: 210px;
  height: auto;
  object-fit: contain;
}

.login-headline {
  display: grid;
  gap: 14px;
  max-width: 610px;
}

.login-headline h1 {
  color: var(--primary);
  font-size: 34px;
  line-height: 1.08;
}

.login-headline p {
  color: var(--primary-dark);
  font-size: 32px;
  line-height: 1.18;
}

.login-metrics {
  position: relative;
  min-height: 270px;
}

.login-card {
  position: absolute;
  display: grid;
  gap: 8px;
  width: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card span,
.login-card small {
  color: var(--muted);
  font-weight: 700;
}

.login-card strong {
  color: var(--primary);
  font-size: 34px;
}

.login-card.card-main {
  left: 0;
  top: 0;
}

.login-card.card-progress {
  left: 0;
  top: 130px;
  width: 210px;
}

.login-card.card-list {
  left: 250px;
  top: 130px;
  width: 290px;
}

.login-security {
  display: grid;
  gap: 4px;
  max-width: 620px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  padding: 24px 32px;
}

.login-security strong {
  font-size: 20px;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-panel {
  display: grid;
  gap: 20px;
  width: min(100%, 660px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(12, 42, 97, 0.12);
  padding: 48px;
}

.login-eyebrow {
  color: var(--accent);
  font-weight: 800;
}

.login-panel h2 {
  color: var(--primary);
  font-size: 38px;
  line-height: 1.1;
}

.login-panel p {
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.login-panel button {
  min-height: 56px;
  background: #236be8;
  font-size: 16px;
  font-weight: 800;
}

.login-error {
  border: 1px solid #f1b8b8;
  border-radius: 6px;
  color: var(--danger);
  background: #fff5f5;
  padding: 12px;
}

.login-safe {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.login-safe span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--line);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  color: var(--text);
  background: #e7ecef;
}

button.danger {
  background: var(--danger);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.multi-select {
  min-height: 112px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.help-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.compact-help {
  margin-top: -4px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

h4 {
  margin: 0;
  font-size: 15px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffffee;
  backdrop-filter: blur(10px);
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup img {
  display: block;
  width: 285px;
  max-height: 72px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 4px;
  min-width: 230px;
}

.brand-copy strong {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1.05;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.topbar nav {
  display: flex;
  gap: 16px;
}

.topbar a,
.topbar nav button {
  color: var(--primary-dark);
  border: 0;
  background: transparent;
  font-weight: 700;
  text-decoration: none;
}

.topbar nav button {
  min-height: 38px;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0 4px;
}

.topbar nav button:hover,
.topbar nav button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topbar-user button {
  min-height: 34px;
  color: var(--primary);
  padding: 0 12px;
}

@media (max-width: 1280px) {
  .brand-lockup img {
    width: 240px;
    max-height: 62px;
  }

  .brand-copy {
    min-width: 200px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy span {
    font-size: 12px;
  }
}

body.enriched-mode {
  overflow: hidden;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 18px;
  min-width: 0;
  padding: 18px;
}

.sidebar,
.content,
.panel,
.band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding: 16px;
}

.home-brand {
  display: none;
}

.home-brand img {
  width: min(360px, 100%);
  height: auto;
  object-fit: contain;
}

.home-brand p {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.companies-heading {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.companies-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.companies-toolbar button {
  min-height: 34px;
  padding: 0 12px;
}

body:not(.start-mode) .home-brand,
body:not(.start-mode) .company-create-header,
body:not(.start-mode) #company-form {
  display: none;
}

body:not(.start-mode) .workspace {
  grid-template-columns: 1fr;
}

body:not(.start-mode) .sidebar {
  display: none;
}

body.enriched-mode .workspace {
  height: calc(100vh - 64px);
  overflow: hidden;
  padding: 14px 18px;
}

body.enriched-mode .content {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

body.enriched-mode #company-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.enriched-mode .company-summary {
  margin-bottom: 14px;
}

.start-mode .topbar nav {
  display: none;
}

.start-mode .workspace {
  display: block;
  min-height: calc(100vh - 64px);
  padding: 32px;
}

.start-mode .sidebar {
  position: static;
  max-width: 760px;
  max-height: none;
  margin: 0 auto;
  padding: 28px;
}

.start-mode .home-brand {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.start-mode .companies-toolbar button {
  display: none;
}

.start-mode .section-title {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.start-mode #company-form {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.start-mode .list-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 14px;
}

.start-mode .list-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.start-mode .list-item strong,
.start-mode .list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-mode .list-item button {
  justify-self: end;
}

.start-mode .content {
  display: none;
}

.content {
  min-width: 0;
  min-height: calc(100vh - 100px);
  overflow: hidden;
  padding: 18px;
}

.company-summary {
  border-top: 4px solid var(--primary);
  box-shadow: 0 10px 24px rgba(12, 42, 97, 0.08);
}

.company-summary .section-title {
  margin-bottom: 0;
}

.company-summary h2 {
  color: var(--primary-dark);
}

.company-summary-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(280px, 1fr) minmax(160px, 220px) minmax(280px, 420px) auto;
  gap: 14px;
  align-items: center;
}

.company-summary-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.company-summary-block h2,
.company-summary-block strong,
.company-summary-block p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-summary-block strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.company-switcher {
  align-self: end;
}

.band,
.panel {
  min-width: 0;
  margin-bottom: 18px;
  padding: 16px;
}

.collapsible-panel {
  padding: 0;
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 58px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary::before {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--primary);
  content: "";
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.collapsible-panel[open] > .collapsible-summary::before {
  transform: rotate(90deg);
}

.collapsible-summary > div {
  min-width: 0;
}

.collapsible-summary > .status-pill,
.collapsible-summary > .muted:last-child {
  margin-left: auto;
}

.collapsible-summary h3,
.collapsible-summary p {
  margin: 0;
}

.collapsible-summary p {
  margin-top: 4px;
  color: var(--muted);
}

.collapsible-content {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

#powerbi .powerbi-layout {
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  align-items: stretch;
}

#powerbi .powerbi-layout > div,
#powerbi .powerbi-endpoint-column {
  min-width: 0;
}

#powerbi .powerbi-token-column {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
}

#powerbi #powerquery-code {
  max-height: 260px;
  overflow: auto;
}

#powerbi #tokens-list {
  min-height: 320px;
  max-height: none;
  overflow: auto;
}

.stack {
  display: grid;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title p {
  margin-top: 4px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #edf2f4;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  background: #dff4e9;
  color: var(--ok);
}

.status-pill.warn {
  background: #fff2d6;
  color: var(--warn);
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.list-item button {
  justify-self: start;
}

.list-item.active {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--primary);
}

.group-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.group-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.project-admin {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.project-current,
.project-quality-link {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.project-current {
  border-top: 4px solid var(--primary);
}

.project-quality-link {
  border-top: 4px solid var(--accent);
}

details.project-quality-link.collapsible-panel {
  display: block;
  padding: 0;
}

.project-current .section-title,
.project-quality-link .section-title {
  align-items: flex-start;
  margin-bottom: 0;
}

.project-quality-link button {
  min-height: 36px;
}

.project-current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-current-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  padding: 10px;
}

.project-current-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subproject-window {
  display: grid;
  gap: 8px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  padding: 10px;
}

.subproject-window-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subproject-window .check-grid {
  max-height: 320px;
  padding: 0;
}

.project-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.project-row > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-row strong,
.project-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row .row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.project-row button {
  min-height: 34px;
  padding: 0 12px;
}

.project-row.active {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--primary);
}

.compact {
  max-height: 320px;
  overflow: auto;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.empty-state {
  display: grid;
  min-height: 50vh;
  place-items: center;
  color: var(--muted);
}

.mini-output,
.json-output {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: #263238;
  padding: 10px;
}

.query-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.query-side,
.query-main {
  display: grid;
  gap: 12px;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.readable-select {
  min-height: 152px;
  width: 100%;
}

.compact-select {
  min-height: 96px;
}

.table-tools {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px) minmax(180px, 240px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.users-view {
  display: grid;
  gap: 24px;
  align-self: start;
}

.user-search {
  width: min(100%, 420px);
}

.user-form-grid {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr) minmax(220px, 1fr) minmax(170px, 1fr)
    minmax(140px, 190px) minmax(180px, 260px) auto;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.user-form-actions {
  display: flex;
  gap: 8px;
}

.users-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.users-table table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
}

.users-table th {
  color: var(--muted);
  background: #f7fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.users-table td:first-child {
  display: grid;
  gap: 4px;
}

.users-table .row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

#result-table {
  max-height: min(64vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
}

body.enriched-mode #enriched-data-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

body.enriched-mode #enriched-data-view.hidden {
  display: none !important;
}

body.enriched-mode .enriched-layout,
body.enriched-mode .enriched-main {
  min-height: 0;
  overflow: hidden;
}

body.enriched-mode #dynamic-enriched-table {
  height: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

.managed-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  padding: 8px 10px;
}

.hidden-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.column-chip,
.compact-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.column-chip {
  color: var(--primary-dark);
  background: #edf2f4;
}

.column-chip:hover {
  background: #dfe9ee;
}

.managed-table-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

th,
td {
  min-width: 128px;
  max-width: 280px;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: #eef4f6;
  z-index: 1;
  white-space: nowrap;
}

.managed-th {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.column-sort,
.column-hide {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.column-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  color: var(--primary-dark);
  background: transparent;
  text-align: left;
}

.column-sort:hover,
.column-sort.active {
  color: var(--primary);
  background: #dfe9ee;
}

.sort-indicator {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.column-hide {
  color: var(--muted);
  background: #edf2f4;
}

.column-hide:hover {
  color: var(--danger);
  background: #f9e1e4;
}

#dynamic-enriched-table td {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dynamic-enriched-table td:hover {
  white-space: normal;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.alert {
  border: 1px solid #f0d08a;
  border-radius: 6px;
  background: #fff8e8;
  color: #664600;
  padding: 10px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.suggestions button {
  background: var(--accent);
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.module-tabs button {
  color: var(--primary-dark);
  background: #e7ecef;
}

.module-tabs button.active {
  color: #fff;
  background: var(--primary);
}

.module-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.module-panel {
  min-width: 0;
}

.enriched-layout,
.enriched-main {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

.enriched-layout {
  gap: 12px;
}

.enriched-main {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.enriched-selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.enriched-selected-summary > div {
  min-width: 0;
}

.enriched-selected-summary h4,
.enriched-selected-summary p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enriched-powerbi-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  padding: 10px;
}

.dynamic-enriched-config {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  padding: 10px;
}

.dynamic-enriched-config summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 800;
}

.dynamic-enriched-config-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.dynamic-enriched-config pre {
  max-height: 170px;
  overflow: auto;
}

.enriched-powerbi-box summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 800;
}

.enriched-powerbi-content {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.enriched-powerbi-content button {
  justify-self: start;
}

.enriched-powerbi-content pre {
  max-height: 180px;
  overflow: auto;
}

.compact-title {
  align-items: flex-start;
  margin-bottom: 10px;
}

.log-history-title {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.empty-inline {
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 14px;
}

.autodesk-access-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr);
  gap: 14px;
  margin-bottom: 14px;
}

.autodesk-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.autodesk-meta {
  display: grid;
  grid-template-columns: minmax(86px, auto) 1fr;
  gap: 8px 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.autodesk-meta strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.autodesk-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.folder-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  margin-bottom: 8px;
}

.folder-trail button,
.folder-trail span {
  min-height: 30px;
  border-radius: 999px;
  background: #eef4f6;
  color: var(--primary-dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.folder-trail button {
  border: 0;
  cursor: pointer;
}

.aps-browser-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

.aps-browser-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.aps-browser-row:hover,
.aps-browser-row.active {
  border-color: var(--primary);
  background: #f2f8fa;
}

.aps-browser-row small {
  display: block;
  color: var(--muted);
}

.aps-kind {
  align-self: center;
  border-radius: 999px;
  background: #edf2f4;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.autodesk-config-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.autodesk-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 420px);
  gap: 16px;
  margin-bottom: 14px;
}

.viewer-frame {
  display: grid;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111820;
  color: #d7dee4;
  overflow: hidden;
  place-items: center;
}

.viewer-actions {
  margin-top: 10px;
}

.autodesk-tools {
  grid-template-columns: 1fr auto;
}

#autodesk-elements-table {
  max-height: min(52vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--text);
  font-weight: 600;
}

.check-item input {
  width: 18px;
  min-height: 18px;
}

.project-select-item {
  align-items: flex-start;
}

.project-select-item span {
  display: grid;
  gap: 2px;
}

.project-select-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  background: #1f2933;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 1000px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-story {
    gap: 28px;
    padding: 28px 20px;
  }

  .login-headline h1,
  .login-headline p {
    font-size: 26px;
  }

  .login-metrics {
    display: none;
  }

  .login-panel-wrap {
    padding: 20px;
  }

  .login-panel {
    padding: 28px;
  }

  .login-panel h2 {
    font-size: 30px;
  }

  .workspace,
  .grid.two,
  .company-summary-grid,
  .project-admin,
  .query-layout,
  .table-tools,
  .user-form-grid,
  .enriched-layout,
  .autodesk-config-grid,
  .autodesk-access-grid,
  .autodesk-selector-grid,
  .autodesk-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
  }

  .brand-lockup {
    flex-wrap: wrap;
  }

  .brand-lockup img {
    width: min(285px, 70vw);
    max-height: 72px;
  }

  .brand-copy {
    min-width: min(230px, 70vw);
  }

  .project-row,
  .date-grid {
    grid-template-columns: 1fr;
  }

  .start-mode .workspace {
    padding: 16px;
  }

  .start-mode #company-form,
  .start-mode .list-item {
    grid-template-columns: 1fr;
  }

  .start-mode .list-item button {
    justify-self: start;
  }
}
