/* Layout del shell principal */
body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 48px;
}

.logo {
  font-size: var(--font-size-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-sign {
  color: var(--accent);
  font-weight: 700;
}

.version {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--muted);
  vertical-align: super;
  margin-left: 2px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Dropdown (Biblioteca) ─────────────────────────────────────────────── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: var(--space-xs);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: var(--space-xs) 0;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: var(--font-size-sm);
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.dropdown-item:hover {
  background: var(--surface-alt);
}

.status-msg {
  font-size: var(--font-size-sm);
  color: var(--muted);
  transition: opacity var(--duration) var(--ease);
}

/* ── Tabs bar ──────────────────────────────────────────────────────────── */
.tabs-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tab-btn:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Tab icons ─────────────────────────────────────────────────────────── */
.tab-icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  opacity: 0.5;
  filter: var(--icon-filter, none);
}

.tab-btn.active .tab-icon {
  opacity: 1;
}

/* ── Título del texto activo en la tab bar ────────────────────────────── */
.tab-source-title {
  display: none;
  align-items: center;
  margin-left: var(--space-md);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-reading);
  line-height: 1;
}

.tab-source-title.visible {
  display: flex;
}

/* ── SVG icon inside buttons ─────────────────────────────────────────── */
.btn-svg-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  filter: var(--icon-filter, none);
}

/* ── Tab panels ────────────────────────────────────────────────────────── */
.tab-panels {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  position: absolute;
  inset: 0;
}

.tab-panel.active {
  display: flex;
}

/* ── Split view ────────────────────────────────────────────────────────── */
.split-view {
  display: flex;
  width: 100%;
  height: 100%;
}

.split-left {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.split-right {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.split-handle {
  width: 5px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background var(--duration) var(--ease);
  position: relative;
}

.split-handle:hover,
.split-handle.dragging {
  background: var(--accent);
}

/* ── Panel internos ────────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  min-height: 40px;
}

.panel-header h2 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--bg);
}

.placeholder {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-xl);
}
