/* ═══════════════════════════════════════════════ */
/*  HEADER                                         */
/* ═══════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--phase-fill);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-text);
}

.header-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.header-branch {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right > * {
  height: 32px;
  display: inline-flex;
  align-items: center;
}

.header-right .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.header-right select {
  height: 32px;
}

.header-right .badge {
  height: 32px;
}

.header-right .theme-toggle {
  width: 32px;
  height: 32px;
}

.header-refresh-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.header-refresh-btn:hover {
  border-color: var(--border-active);
  color: var(--accent);
}

.header-refresh-btn.refreshing {
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Locale Selector */
.locale-select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
  font-size: 16px;
}
.theme-toggle:hover { border-color: var(--border-active); color: var(--accent); }

/* ═══════════════════════════════════════════════ */
/*  SIDEBAR                                        */
/* ═══════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(56px + 12px);
  gap: 4px;
  z-index: 95;
}

.sidebar-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.sidebar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.sidebar-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════ */
/*  TAB BAR                                        */
/* ═══════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  margin-left: var(--sidebar-width);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  position: relative;
  z-index: 90;
}

.tab-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition);
}

.tab-btn:hover { color: var(--text-secondary); }

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

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--tab-indicator);
  border-radius: 2px 2px 0 0;
}

/* ═══════════════════════════════════════════════ */
/*  MAIN CONTENT                                   */
/* ═══════════════════════════════════════════════ */
.main {
  position: relative;
  z-index: 1;
  margin-left: var(--sidebar-width);
  padding: 0;
  overflow: hidden;
  height: calc(100vh - 56px - 40px);
}

/* Let panels fill available width — no horizontal scroll */
.tab-panel {
  max-width: 100%;
}

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════ */
/*  CARDS                                          */
/* ═══════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.card:hover { border-color: color-mix(in srgb, var(--border-active) 40%, var(--border)); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Center card titles absolutely — independent of button widths */
.card-header {
  position: relative;
}

.card-header .card-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.card-body { padding: 18px; }

/* ═══════════════════════════════════════════════ */
/*  BADGES & TAGS                                  */
/* ═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info { background: var(--info-dim); color: var(--info); }

/* ═══════════════════════════════════════════════ */
/*  BUTTONS                                        */
/* ═══════════════════════════════════════════════ */
.btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { border-color: var(--border-active); background: var(--bg-hover); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

/* ═══════════════════════════════════════════════ */
/*  BUTTON DROPDOWN                                */
/* ═══════════════════════════════════════════════ */
.btn-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 120px;
  margin-top: 4px;
}

.btn-dropdown-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.btn-dropdown-item:hover {
  background: var(--bg-hover);
}

