/* Production adapter for the prototype workspace topology.
   These sections are ported from prototype/styles.css, navigation.css,
   workspace.css, profile.css, and global-search.css. */

.workspace-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.workspace-shell > .topbar {
  flex-shrink: 0;
  min-height: 65px;
  gap: 10px;
  padding: 10px 12px;
  overflow: visible;
  background: var(--tab-bar);
  border-bottom-color: var(--tab-active);
}

.workspace-tabs-area {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
  align-items: flex-start;
  overflow: hidden;
  order: 0;
}

#workspace-tabs {
  display: flex;
  flex: 0 1 auto;
  width: auto;
  max-width: calc(100% - 71px);
  min-width: 24px;
  align-items: flex-start;
  gap: 3px;
  overflow: hidden;
}

#workspace-tabs .ptab {
  display: flex;
  flex: 0 1 190px;
  width: 190px;
  min-width: 0;
  height: 34px;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px 9px 3px 3px;
  background: var(--tab-bg);
  color: var(--tab-text);
}

#workspace-tabs .ptab.selected {
  height: 42px;
  border-radius: 9px 9px 0 0;
  background: var(--tab-active);
  color: var(--tab-active-text);
}

#workspace-tabs .ptab [role="tab"] {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--tab-text);
  white-space: nowrap;
}

#workspace-tabs .ptab.selected [role="tab"],
#workspace-tabs .ptab.selected .ptab-close {
  color: var(--tab-active-text);
  font-weight: 650;
}

#workspace-tabs .ptab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#workspace-tabs .ptab-close {
  flex: 0 0 24px;
  height: 32px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--tab-text);
}

#workspace-tabs .ptab:hover,
#workspace-tabs .ptab-close:hover {
  filter: brightness(.96);
}

#workspace-tabs .ptab-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 3px;
  align-items: flex-start;
  overflow: hidden;
}

#workspace-tabs .ptab-strip.icons-only .ptab-label {
  display: none;
}

#workspace-tabs .ptab-strip.icons-only [role="tab"] {
  justify-content: center;
  padding: 0;
}

#workspace-new,
#workspace-all {
  flex: 0 0 auto;
  align-self: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--tab-text);
}

#workspace-new {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  line-height: 1;
}

#workspace-new svg { display: block; width: 18px; height: 18px; }
#workspace-all { padding: 6px; font-size: 11px; }

.workspace-account {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  gap: 7px;
  order: 0;
  margin-left: auto;
}

.workspace-account #workspace-clock {
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: .3px;
  white-space: nowrap;
}

.workspace-account .avatar {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--link);
  font-size: 11px;
  font-weight: 650;
}
.workspace-account .avatar.avatar-photo{overflow:hidden;background:transparent}.workspace-account .avatar.avatar-photo img{inline-size:100%;block-size:100%;object-fit:cover}

.workspace-account .global-search {
  position: relative;
  width: clamp(165px, 20vw, 300px);
  min-width: 150px;
  flex-shrink: 1;
}

.global-search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.global-search-field input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
}

.ask-ai { white-space: nowrap; }

/* Keep the compact tools docked beside the profile. Tabs own all remaining
   header space instead of yielding it to an empty, centered tools area. */
.topbar-tools { flex: 0 1 auto; margin-left: auto; }
.topbar-tools .global-search { flex: 0 1 clamp(170px, 17vw, 280px); max-width:280px; }

.profile-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
}

.profile-trigger {
  min-height: 36px;
  padding: 8px 10px !important;
  border-radius: var(--shell-radius);
  background: transparent !important;
  color: var(--tab-text) !important;
}

.profile-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  z-index: 300;
  width: 290px;
  max-width: 85vw;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 35px #172b4730;
}

.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover { background: var(--surface-alt); }

/* The account menu is a shell-level overlay, never a table child. Sticky
   register headers therefore cannot cover it. */
.workspace-shell > .topbar { position: relative; z-index: 1000; }
.workspace-shell > main { position: relative; z-index: 0; }

.workspace-shell > main { flex: 1; min-height: 0; }

@media (max-width: 800px) {
  .workspace-shell > .topbar { flex-wrap: wrap; }
  .workspace-tabs-area { flex-basis: 100%; order: 2; width: 100%; }
  .workspace-account { width: 100%; order: 1; justify-content: flex-end; }
  .workspace-account .global-search { width: 160px; max-width: 40vw; }
}

@media (max-width: 600px) {
  .workspace-account .global-search { width: 150px; }
  .workspace-account #workspace-clock { font-size: 16px; }
  .workspace-account .global-search input { min-width: 0; }
}

[data-theme="dark"] #workspace-new,
[data-theme="dark"] #workspace-all,
[data-theme="dark"] .profile-trigger { color: var(--tab-text) !important; }
