/* Qorgon Ustaxona v14 — universal Laboratory + Tool Manager shell */

.runtime-status-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  font-size: 10px;
}

.runtime-status-chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: color-mix(in srgb, var(--blue) 7%, var(--surface-2));
}

.runtime-status-chip strong { color: var(--text); font-size: 10px; }
.runtime-status-chip small { color: var(--muted); font-size: 9px; }
.runtime-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #37be7d; box-shadow: 0 0 0 3px color-mix(in srgb, #37be7d 12%, transparent); }
.top-actions { margin-left: 0; }

.workshop-dashboard.v14 .workshop-compact-toolbar {
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  gap: 6px;
}

.workshop-dashboard.v14 .workshop-compact-toolbar.special-page {
  grid-template-columns: minmax(150px, 1fr) 1fr auto auto;
}

.workshop-shared-toggle,
.workshop-tool-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.workshop-shared-toggle:hover,
.workshop-tool-action:hover,
.workshop-shared-toggle.active {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-color: color-mix(in srgb, var(--blue) 15%, transparent);
}

.workshop-shared-toggle svg,
.workshop-tool-action svg { width: 14px; height: 14px; }
.workshop-toolbar-spacer { min-width: 8px; }

.laboratory-page,
.resources-page { display: grid; gap: 14px; }

.laboratory-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
}

.laboratory-hero > div:first-child { display: flex; align-items: center; gap: 11px; min-width: 0; }
.laboratory-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, var(--surface));
}
.laboratory-hero-icon svg { width: 20px; height: 20px; }
.laboratory-hero h2,
.laboratory-hero p { margin: 0; }
.laboratory-hero h2 { font-size: 14px; }
.laboratory-hero p { margin-top: 3px; color: var(--muted); font-size: 10px; }

.laboratory-catalog-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-size: 10px;
  font-weight: 750;
}
.laboratory-catalog-button svg { width: 15px; height: 15px; }

.laboratory-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
}
.laboratory-block > header { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.laboratory-block > header h3,
.laboratory-block > header p { margin: 0; }
.laboratory-block > header h3 { font-size: 12px; }
.laboratory-block > header p { margin-top: 2px; color: var(--muted); font-size: 9px; }
.laboratory-block > header b { color: var(--muted); font-size: 10px; }

.lab-tool-list { display: grid; gap: 1px; }
.lab-tool-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 7px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--text);
  background: transparent;
  text-align: left;
}
.lab-tool-row:last-child { border-bottom: 0; }
.lab-tool-row:hover { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.lab-tool-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface));
}
.lab-tool-icon svg { width: 16px; height: 16px; }
.lab-tool-copy { display: grid; gap: 2px; min-width: 0; }
.lab-tool-copy strong { font-size: 10px; }
.lab-tool-copy small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-tool-status { color: #37be7d; font-size: 9px; font-weight: 700; }
.lab-tool-row > svg { width: 14px; height: 14px; color: var(--muted); }

.lab-session-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lab-session-grid article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 10px;
  background: var(--surface-2);
}
.lab-session-grid article > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--blue); background: var(--surface); }
.lab-session-grid article svg { width: 16px; height: 16px; }
.lab-session-grid article div { display: grid; gap: 2px; min-width: 0; }
.lab-session-grid strong { font-size: 10px; }
.lab-session-grid small { color: var(--muted); font-size: 9px; }
.lab-session-grid em { color: #37be7d; font-size: 9px; font-style: normal; font-weight: 700; }

.runtime-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
}
.runtime-summary-card > header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.runtime-summary-card > header > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.runtime-summary-card > header svg { width: 19px; height: 19px; }
.runtime-summary-card h2,
.runtime-summary-card p,
.runtime-summary-card small { margin: 0; }
.runtime-summary-card h2 { font-size: 14px; }
.runtime-summary-card p,
.runtime-summary-card small { color: var(--muted); font-size: 9px; }
.runtime-summary-card > header b { display: inline-flex; align-items: center; gap: 6px; color: #37be7d; font-size: 9px; }
.runtime-summary-card > header b i { width: 7px; height: 7px; border-radius: 50%; background: #37be7d; }
.runtime-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.resource-meter { display: grid; gap: 6px; }
.resource-meter > div { display: flex; justify-content: space-between; gap: 8px; }
.resource-meter strong { font-size: 10px; }
.resource-meter div span { color: var(--muted); font-size: 9px; }
.resource-meter > span { height: 4px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.resource-meter > span i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }

.resource-note { display: flex; gap: 10px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--blue) 14%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--blue) 5%, transparent); }
.resource-note > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--blue); }
.resource-note strong { font-size: 10px; }
.resource-note p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.runtime-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.runtime-targets article { display: grid; justify-items: start; gap: 5px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.runtime-targets article.active { border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.runtime-targets svg { width: 17px; height: 17px; color: var(--blue); }
.runtime-targets strong { font-size: 10px; }
.runtime-targets small { color: var(--muted); font-size: 9px; }

.tool-manager-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(5, 12, 18, .54);
  backdrop-filter: blur(8px);
}
.tool-manager-overlay[hidden] { display: none !important; }
.tool-manager-window {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 52px));
  height: min(760px, calc(100dvh - 52px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
}
.tool-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tool-manager-head > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tool-manager-head > div > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 11%, var(--surface)); }
.tool-manager-head svg { width: 18px; height: 18px; }
.tool-manager-head h2,
.tool-manager-head p { margin: 0; }
.tool-manager-head h2 { font-size: 14px; }
.tool-manager-head p { margin-top: 2px; color: var(--muted); font-size: 9px; }
.tool-manager-tabs { display: flex; gap: 2px; min-height: 39px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tool-manager-tabs button { position: relative; padding: 0 12px; border: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.tool-manager-tabs button.active { color: var(--blue); }
.tool-manager-tabs button.active::after { content: ""; position: absolute; right: 10px; bottom: 0; left: 10px; height: 2px; border-radius: 2px 2px 0 0; background: var(--blue); }
.tool-manager-search { display: flex; align-items: center; gap: 8px; margin: 9px 12px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.tool-manager-search svg { width: 15px; height: 15px; color: var(--muted); }
.tool-manager-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 10px; }
.tool-manager-body { min-height: 0; display: grid; grid-template-columns: 190px minmax(300px, 1fr) 330px; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.tool-manager-body > aside,
.tool-manager-body > main,
.tool-manager-body > section { min-height: 0; overflow: auto; }
.tool-manager-body > aside { padding: 8px; border-right: 1px solid var(--line); }
.tool-manager-body > aside button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; text-align: left; }
.tool-manager-body > aside button:hover,
.tool-manager-body > aside button.active { color: var(--text); background: var(--surface-2); }
.tool-manager-body > aside button.active { color: var(--blue); }
.tool-manager-body > aside b { font-size: 9px; font-weight: 650; }
.tool-manager-body > main { border-right: 1px solid var(--line); }
.tool-catalog-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 58px; padding: 7px 10px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); color: var(--text); background: transparent; text-align: left; }
.tool-catalog-row:hover,
.tool-catalog-row.active { background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.tool-catalog-row.active { box-shadow: inset 2px 0 0 var(--blue); }
.tool-catalog-row > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }
.tool-catalog-row span svg { width: 17px; height: 17px; }
.tool-catalog-row div { display: grid; gap: 2px; min-width: 0; }
.tool-catalog-row strong { font-size: 10px; }
.tool-catalog-row small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-catalog-row em { color: #37be7d; font-size: 9px; font-style: normal; }
.tool-catalog-row > svg { width: 14px; height: 14px; color: var(--muted); }
.tool-manager-body > section { padding: 14px; }
.tool-detail-title { display: flex; align-items: center; gap: 10px; }
.tool-detail-title > span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.tool-detail-title svg { width: 21px; height: 21px; }
.tool-detail-title small,
.tool-detail-title h3,
.tool-detail-title p { margin: 0; }
.tool-detail-title small,
.tool-detail-title p { color: var(--muted); font-size: 9px; }
.tool-detail-title h3 { margin: 2px 0; font-size: 14px; }
.tool-detail-description { margin: 14px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.tool-detail-specs { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.tool-detail-specs label { display: flex; justify-content: space-between; gap: 8px; padding: 8px 9px; background: var(--surface-2); font-size: 9px; }
.tool-detail-specs label + label { border-top: 1px solid var(--line); }
.tool-detail-specs span { color: var(--muted); }
.tool-detail-permissions { display: grid; gap: 7px; margin-top: 14px; }
.tool-detail-permissions > strong { font-size: 10px; }
.tool-detail-permissions > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.tool-detail-permissions svg { width: 13px; height: 13px; color: #37be7d; }
.tool-install-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 36px; margin-top: 16px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 750; }
.tool-install-button.installed { color: #37be7d; background: color-mix(in srgb, #37be7d 10%, var(--surface)); }
.tool-install-button svg { width: 14px; height: 14px; }
.tool-catalog-empty,
.tool-detail-empty { display: grid; place-items: center; align-content: center; gap: 5px; min-height: 180px; color: var(--muted); font-size: 10px; text-align: center; }
.tool-catalog-empty svg { width: 24px; height: 24px; }

@media (max-width: 1100px) {
  .runtime-status-chip small { display: none; }
  .tool-manager-body { grid-template-columns: 150px minmax(260px, 1fr) 280px; }
  .workshop-shared-toggle span,
  .workshop-tool-action span { display: none; }
}

@media (max-width: 820px) {
  .runtime-status-chip { display: none; }
  .workshop-dashboard.v14 .workshop-compact-toolbar,
  .workshop-dashboard.v14 .workshop-compact-toolbar.special-page { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .tool-manager-overlay { padding: 0; }
  .tool-manager-window { width: 100vw; height: 100dvh; border-radius: 0; }
  .tool-manager-body { grid-template-columns: 110px 1fr; }
  .tool-manager-body > section { display: none; }
  .lab-session-grid,
  .runtime-resource-grid,
  .runtime-targets { grid-template-columns: 1fr; }
}
