/* The authenticated workspace shares the public demo's surfaces and rhythm.
   Keep shell positioning, operational colours and modal layouts in their owners.
   Zero-specificity exclusions preserve binding dialogs and the guided tour. */
.app-layout {
  --workspace-shadow: 0 4px 20px rgb(38 35 45 / 4%);
  --workspace-card-radius: 12px;
  font-size: 15px;
  line-height: 1.65;
}

:root[data-theme="dark"] .app-layout {
  --workspace-shadow: 0 4px 20px rgb(0 0 0 / 12%);
}

.app-layout .workspace-content > main {
  padding: 30px clamp(18px, 2.5vw, 42px) 42px;
}

.app-layout .workspace-content > main > h1,
.app-layout .workspace-heading h1 {
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.035em;
  margin: 4px 0 22px;
  overflow-wrap: anywhere;
}

.app-layout .workspace-heading > p {
  color: var(--muted);
  margin: -8px 0 24px;
  max-width: 70ch;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--workspace-card-radius);
  background: var(--surface);
  box-shadow: var(--workspace-shadow);
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > h2,
.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > .actions > h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.015em;
  margin: 0 0 16px;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > p {
  margin: 12px 0;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > p:first-child {
  margin-top: 0;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > p:last-child {
  margin-bottom: 0;
}

.app-layout .section,
.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) + .grid,
.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) + .panel {
  margin-top: 22px;
}

.app-layout .grid {
  gap: 22px;
  align-items: start;
}

.app-layout .grid > .panel,
.app-layout .kpi-grid:where(:not(dialog *, [data-demonstration-root] *)) > .panel {
  margin-top: 0;
}

.app-layout .kpi-grid:where(:not(dialog *, [data-demonstration-root] *)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) {
  padding: 19px 22px 20px;
  border-top: 3px solid var(--primary-bg);
  gap: 6px;
  min-width: 0;
}

.app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) > span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}

.app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) > strong {
  font-size: clamp(29px, 2.8vw, 37px);
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -.035em;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) > small {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.app-layout .status-chip {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.app-layout .tabs:where(:not(dialog *, [data-demonstration-root] *)) {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin: 0 0 22px;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.app-layout .tabs:where(:not(dialog *, [data-demonstration-root] *)) a {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 7px 7px 0 0;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.5;
}

.app-layout .tabs:where(:not(dialog *, [data-demonstration-root] *)) a:hover {
  background: var(--surface-subtle);
  border-bottom-color: var(--line);
}

.app-layout .tabs:where(:not(dialog *, [data-demonstration-root] *)) a[aria-current="page"] {
  color: var(--heading);
  background: var(--surface);
  border-bottom-color: var(--primary-bg);
  font-weight: 750;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > .actions {
  align-items: center;
  gap: 12px;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > .actions > h2 {
  margin: 0;
}

.app-layout form.actions.panel,
.app-layout .workspace-filters {
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
  background: var(--surface);
}

.app-layout form.actions.panel > label,
.app-layout .workspace-filters > label {
  flex-basis: 160px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  gap: 6px;
  margin: 0;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) :is(input, select, textarea) {
  border-radius: 8px;
  min-width: 0;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 42px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) :is(input, textarea)[readonly] {
  background: var(--surface-subtle);
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) :is(input, select, textarea):disabled {
  opacity: .6;
  cursor: not-allowed;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) :is(button, .button),
.app-layout .export-action > button {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) .primary,
.app-layout .export-action > .primary {
  font-weight: 650;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) .helptext {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 6px;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) fieldset {
  border-color: var(--line);
  border-radius: 9px;
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > details {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > details > summary {
  color: var(--heading);
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) {
  max-width: 100%;
  border-color: var(--line);
  border-radius: 8px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) > table {
  margin: 0;
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) th,
.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) td {
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.55;
  border-color: var(--line);
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) th {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) tbody tr:last-child > td {
  border-bottom: 0;
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) tr > :last-child {
  border-right: 0;
}

.app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) td small {
  font-size: 11px;
  line-height: 1.5;
}

.app-layout .catalog-row-actions .button,
.app-layout .catalog-row-actions button {
  font-size: 12px;
}

.app-layout .empty-state:where(:not(dialog *, [data-demonstration-root] *)) {
  padding: 30px 20px;
  line-height: 1.75;
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.app-layout #overview {
  border-top: 4px solid var(--primary-bg);
}

.app-layout #overview > .actions:first-child > span:not(.status-chip) {
  color: var(--muted);
  font-size: 13px;
}

.app-layout #overview > nav.actions a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  background: var(--surface-subtle);
  font-size: 13px;
}

.app-layout #overview > nav.actions a:hover {
  background: var(--hover);
}

.app-layout .project-sample {
  border-top: 4px solid var(--primary-bg);
}

.app-layout .project-sample > p {
  color: var(--muted);
  max-width: 80ch;
}

.app-layout .project-list-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.app-layout .project-list .project-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  border-left: 3px solid var(--primary-bg);
  padding: 17px 18px;
  margin-top: 12px;
}

.app-layout .project-card h3 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.app-layout .project-card h3 > a {
  color: var(--heading);
  text-decoration: none;
}

.app-layout .project-card h3 > a:hover {
  text-decoration: underline;
}

.app-layout .project-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.app-layout .sidebar .nav-item {
  border-radius: 7px;
  font-size: 13px;
}

.app-layout .sidebar .nav-heading {
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: .08em;
}

@media (max-width: 1200px) {
  .app-layout .kpi-grid:where(:not(dialog *, [data-demonstration-root] *)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .app-layout .project-list-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  .app-layout .workspace-content > main {
    padding: 22px 14px 30px;
  }

  .app-layout .workspace-content > main > h1,
  .app-layout .workspace-heading h1 {
    font-size: 25px;
    margin-bottom: 20px;
  }

  .app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) {
    padding: 18px;
  }

  .app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > h2,
  .app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) > .actions > h2 {
    font-size: 18px;
  }

  .app-layout .kpi-grid:where(:not(dialog *, [data-demonstration-root] *)) {
    gap: 10px;
  }

  .app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) {
    padding: 15px;
  }

  .app-layout .kpi:where(:not(dialog *, [data-demonstration-root] *)) > strong {
    font-size: 29px;
  }

  .app-layout .tabs:where(:not(dialog *, [data-demonstration-root] *)) a {
    padding: 11px 13px;
    font-size: 13px;
  }

  .app-layout form.actions.panel > label,
  .app-layout .workspace-filters > label {
    flex-basis: 130px;
  }

  .app-layout form.actions.panel > button {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) th,
  .app-layout .table-wrap:where(:not(dialog *, [data-demonstration-root] *)) td {
    padding: 11px 12px;
  }

  .app-layout .sidebar .nav-item {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .app-layout .kpi-grid:where(:not(dialog *, [data-demonstration-root] *)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-layout .workspace-content > main {
    padding-inline: 12px;
  }

  .app-layout .panel:where(:not(dialog *, [data-demonstration-root] *)) {
    padding: 16px;
  }
}
