/* ==========================================================================
   CSS: APP SHELL / TOP CONTROLS / MAIN TABS
   ========================================================================== */

.wrap {
  width: 100%;
  height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.card {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--nuam-radius-md);
  padding: 12px;
  background-image: var(--grain-bg);
  background-size: 20px 20px;
  background-blend-mode: overlay;
  box-shadow: 0 4px 6px var(--shadow-color-default);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.controls-card {
  position: relative;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.controls-card::before {
  display: none;
}

.controls-card > * {
  position: relative;
}

.controls-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.controls-row + .controls-row {
  margin-top: 10px;
}

.controls-row-top {
  z-index: 3;
  --top-bar-height: var(--top-logo-height, 54px);
  --top-tabs-bridge: 16px;
  align-items: flex-start;
  gap: 12px;
  min-height: calc(var(--top-bar-height) + var(--top-tabs-bridge));
}
.controls-card .top-slot {
  position: relative;
  flex: 0 1 var(--top-search-width, 320px);
  width: var(--top-search-width, 320px);
  max-width: var(--top-search-width, 320px);
  min-width: 0;
  min-height: var(--top-bar-height, 54px);
  align-self: flex-start;
}

.controls-card .top-card {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-image: none;
}

.controls-row-top .logo-wrapper {
  flex: 0 0 auto;
  margin-bottom: 0;
  align-self: flex-start;
}

    .controls-row-top .top-slot {
  margin-left: auto;
}

#search-card .search-row {
  justify-content: flex-end;
}

#search-card .search-autocomplete {
  flex: 0 0 100%;
  width: 100%;
}

.top-tabs-slot {
  --tabs-strip-bg: var(--accent-primary-border-faint);
  --tabs-strip-separator: var(--text-disabled);
  --tabs-hover-bg: var(--surface-panel);
  --tabs-pane-bg: var(--surface-page);
  --pseudo-hover: var(--surface-panel-opaque);
  flex: 0 1 auto;
  min-width: 0;
  height: calc(var(--top-bar-height) + var(--top-tabs-bridge));
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
  margin-bottom: 0;
  position: relative;
  z-index: 4;
  overflow: visible;
}

.tabs-bar-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 0;
  height: 100%;
  min-height: 0;
  border-radius: var(--nuam-radius-none);
  overflow-x: auto;
  overflow-y: visible;
}

.tabs-bar-top .tabs-btn {
  height: 100%;
}


.tabs-bar-top .tabs-btn-label {
  transform: none;
  display: flex;
  align-items: center;
  height: var(--top-bar-height, 54px);
  font-weight: 700;
}

.tabs-bar-top::-webkit-scrollbar {
  display: none;
}

#search-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#search-card.ready {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.controls-card #search-card .search-row {
  height: var(--top-bar-height, 54px);
}

.controls-row-top .search-input {
  height: var(--top-bar-height, 54px);
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.grow {
  flex: 1;
  min-width: 0;
}

.search-autocomplete {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--accent-primary-border);
  border-radius: var(--nuam-radius-md);
  background: var(--surface-app);
  color: var(--text-primary);
  font-family: var(--app-font-family);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:hover {
  border-color: var(--accent-primary);
}

.search-input.highlight {
  border-color: var(--status-danger);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  font-family: var(--app-font-family) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  box-shadow: 0 0 0px 1000px var(--surface-app) inset !important;
  border: 1px solid var(--accent-primary) !important;
}

.button {
  height: 42px;
  padding: 0 14px;
  background-color: var(--state-emphasis-bg);
  color: var(--text-primary);
  border: 1px solid var(--accent-primary-border-transparent);
  border-radius: var(--nuam-radius-md);
  cursor: pointer;
  transition: border-color 0.3s ease;
  font-family: var(--app-font-family);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--accent-primary);
  text-decoration: none;
}

.button.secondary {
  background-color: transparent;
  border: 1px solid var(--accent-primary-border);
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}
