/* Barra de título custom (Electron frameless) */
.titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: linear-gradient(180deg, #141820 0%, #0b0d10 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-app-region: drag;
  user-select: none;
  z-index: 10000;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  min-width: 0;
}

.titlebar-brand img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.titlebar-brand span {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #e8edf5);
  opacity: 0.92;
}

.titlebar-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  color: #9aa3b2;
  transition: background 0.12s, color 0.12s;
}

.titlebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e8edf5;
}

.titlebar-btn.close:hover {
  background: #e81123;
  color: #fff;
}

.titlebar-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}

body.has-titlebar {
  padding-top: 36px;
  box-sizing: border-box;
}

body.has-titlebar,
body.has-titlebar html {
  height: 100%;
}

body.has-titlebar #app {
  height: calc(100vh - 36px);
}

body.has-titlebar .settings-overlay,
body.has-titlebar .srv-settings-overlay,
body.has-titlebar .modal-backdrop {
  top: 36px;
  height: calc(100% - 36px);
}

body.has-titlebar .srv-settings-overlay .settings-close {
  top: 56px;
}
